(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 6.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[    269602,       5673]
NotebookOptionsPosition[    262632,       5440]
NotebookOutlinePosition[    263114,       5460]
CellTagsIndexPosition[    263071,       5457]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["Introduction", "Subtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.409504746608872*^9, 3.4095047490523853`*^9}, {
  3.4151260430023513`*^9, 3.4151260473886585`*^9}, {3.4151261308186245`*^9, 
  3.41512614416782*^9}, {3.422120356104384*^9, 3.422120372327712*^9}, {
  3.422120460955152*^9, 3.422120474825096*^9}, {3.4221205065106573`*^9, 
  3.422120523234706*^9}}],

Cell["\<\
Base directory is either notebook directory if front end enabled or directory \
where kernal was started using commnand:
math.exe [packageName]
 To run the same cells as will be run from the command line choose Evaluation \
=> Evaluate initialization cells.  Note: this will quit kernel when done.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.409504746608872*^9, 3.4095047490523853`*^9}, {
   3.4151260430023513`*^9, 3.4151260473886585`*^9}, {3.4151261308186245`*^9, 
   3.41512614416782*^9}, {3.422120356104384*^9, 3.422120372327712*^9}, {
   3.422120460955152*^9, 3.422120474825096*^9}, {3.4221205065106573`*^9, 
   3.4221205326482415`*^9}, 3.4221205670877633`*^9, {3.4221228082804403`*^9, 
   3.422122883999318*^9}, {3.42212300991037*^9, 3.42212303085048*^9}}],

Cell[BoxData[{
 RowBox[{"basedir", "=", " ", 
  RowBox[{"If", "[", 
   RowBox[{
    RowBox[{"$FrontEnd", "===", "Null"}], ",", 
    RowBox[{"Directory", "[", "]"}], ",", " ", 
    RowBox[{"NotebookDirectory", "[", "]"}]}], "]"}]}], "\[IndentingNewLine]", 
 RowBox[{"scriptinfo", " ", "=", " ", 
  RowBox[{"If", "[", 
   RowBox[{
    RowBox[{"$FrontEnd", "===", "Null"}], ",", "\[IndentingNewLine]", 
    "\"\<Running package kernell only\>\"", ",", "\[IndentingNewLine]", " ", 
    RowBox[{"ToFileName", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"\"\<FileName\>\"", " ", "/.", " ", 
         RowBox[{"NotebookInformation", "[", "]"}]}], ")"}], "[", 
       RowBox[{"[", "1", "]"}], "]"}], ",", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{"\"\<FileName\>\"", " ", "/.", " ", 
         RowBox[{"NotebookInformation", "[", "]"}]}], ")"}], "[", 
       RowBox[{"[", "2", "]"}], "]"}]}], "]"}]}], "]"}]}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.409504746608872*^9, 3.4095047490523853`*^9}, {
  3.4151260430023513`*^9, 3.4151260473886585`*^9}, {3.4151261308186245`*^9, 
  3.41512614416782*^9}, {3.422120356104384*^9, 3.422120372327712*^9}, {
  3.422120460955152*^9, 3.422120474825096*^9}, {3.4221205065106573`*^9, 
  3.4221205568830895`*^9}, {3.422121586974288*^9, 3.422121650065008*^9}, {
  3.4221220066377344`*^9, 3.422122055467949*^9}, {3.4221222873413663`*^9, 
  3.4221223826283827`*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Setup Logging", "Subtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.409504746608872*^9, 3.4095047490523853`*^9}, {
  3.4151260430023513`*^9, 3.4151260473886585`*^9}, {3.4151261308186245`*^9, 
  3.41512614416782*^9}, {3.422120356104384*^9, 3.422120372327712*^9}, {
  3.422120460955152*^9, 3.422120474825096*^9}}],

Cell["\<\
The logging setup is only done so that the notebook may be run automatically \
and the results collected.  LogTest`testLoggingEnabled should be set to False \
unless the test are to be written to a file for tallying.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{
  3.4094964807831984`*^9, {3.40949662913652*^9, 3.409496650737581*^9}, {
   3.409496725254731*^9, 3.4094967789719725`*^9}, 3.409498835168638*^9, {
   3.40949888613192*^9, 3.4094989780641117`*^9}, {3.415126780152321*^9, 
   3.415126871643879*^9}, {3.422119086959443*^9, 3.4221192393085103`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Setup", "[", "]"}], ":=", "\[IndentingNewLine]", 
   RowBox[{"If", "[", 
    RowBox[{"LogTest`testLoggingEnabled", ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Print", "[", "\"\<Logging Enabled\>\"", "]"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"LogTest`testNumber", " ", "=", " ", "1"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"LogTest`fn", " ", "=", 
       RowBox[{"ToFileName", "[", " ", 
        RowBox[{"basedir", ",", "\"\<logTest.txt\>\""}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"LogTest`os", " ", "=", " ", 
       RowBox[{"OpenWrite", "[", "LogTest`fn", "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"WriteString", "[", 
       RowBox[{
       "LogTest`os", ",", "\"\<Starting Test logging\>\"", ",", 
        "\"\<\\n\>\""}], "]"}], ";", "\[IndentingNewLine]", 
      RowBox[{"WriteString", "[", 
       RowBox[{"LogTest`os", ",", "scriptinfo", ",", "\"\<\\n\>\""}], "]"}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"WriteString", "[", 
       RowBox[{"LogTest`os", ",", 
        RowBox[{"DateString", "[", "]"}], ",", "\"\<\\n\\n\>\""}], "]"}], ";",
       "\[IndentingNewLine]", 
      RowBox[{"Close", "[", "LogTest`os", "]"}], ";"}]}], 
    "\[IndentingNewLine]", "]"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Test", "[", 
    RowBox[{"LogTest`testName_String", ",", 
     RowBox[{"LogTest`test_", " ", "/;", " ", 
      RowBox[{"LogTest`test", " ", "\[Element]", " ", "Booleans"}]}]}], "]"}],
    ":=", "\[IndentingNewLine]", " ", 
   RowBox[{"(", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"LogTest`result", " ", "=", "\"\<did not run\>\""}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{"LogTest`test", ",", 
       RowBox[{
        RowBox[{"LogTest`result", " ", "=", " ", "\"\<pass\>\""}], ";"}], ",", 
       RowBox[{
        RowBox[{"LogTest`result", " ", "=", " ", "\"\<fail\>\""}], ";"}]}], 
      "]"}], ";", "\[IndentingNewLine]", 
     RowBox[{"LogTest`str", " ", "=", " ", 
      RowBox[{"StringForm", "[", 
       RowBox[{
       "\"\<`1`...`2`\>\"", ",", "LogTest`testName", ",", "LogTest`result"}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Print", "[", 
      RowBox[{"\"\<Running the test named: \>\"", ",", "LogTest`str"}], "]"}],
      ";", "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{"LogTest`testLoggingEnabled", ",", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"LogTest`os", " ", "=", 
         RowBox[{"OpenAppend", "[", "LogTest`fn", "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"WriteString", "[", 
         RowBox[{"LogTest`os", ",", "\"\<Test \>\"", ",", 
          RowBox[{"LogTest`testNumber", "++"}], ",", "\"\<) \>\"", ",", 
          "LogTest`str", ",", "\"\<\\n\>\""}], "]"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"Close", "[", "LogTest`os", "]"}], ";"}], ",", 
       "\[IndentingNewLine]", "Null"}], "\[IndentingNewLine]", "]"}]}], 
    "\[IndentingNewLine]", ")"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`TestName", "[", "LogTest`testName_String", "]"}], ":=", 
  "\[IndentingNewLine]", " ", 
  RowBox[{"(", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"LogTest`start", " ", "=", " ", 
     RowBox[{"AbsoluteTime", "[", "]"}]}], ";", "\[IndentingNewLine]", 
    RowBox[{"LogTest`result", " ", "=", "\"\<did not run\>\""}], ";", 
    "\[IndentingNewLine]", 
    RowBox[{"LogTest`strTestName", " ", "=", " ", 
     RowBox[{"StringForm", "[", 
      RowBox[{"\"\<`1`\>\"", ",", "LogTest`testName"}], "]"}]}], ";", 
    "\[IndentingNewLine]", 
    RowBox[{"Print", "[", 
     RowBox[{"\"\<Running the test named: \>\"", ",", "LogTest`strTestName"}],
      "]"}], ";", "\[IndentingNewLine]", 
    RowBox[{"If", "[", 
     RowBox[{"LogTest`testLoggingEnabled", ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"LogTest`os", " ", "=", 
        RowBox[{"OpenAppend", "[", "LogTest`fn", "]"}]}], ";", 
       "\[IndentingNewLine]", 
       RowBox[{"WriteString", "[", 
        RowBox[{"LogTest`os", ",", "\"\<Test \>\"", ",", 
         RowBox[{"LogTest`testNumber", "++"}], ",", "\"\<) \>\"", ",", 
         "LogTest`strTestName"}], "]"}], ";", "\[IndentingNewLine]", 
       RowBox[{"Close", "[", "LogTest`os", "]"}], ";"}], ",", 
      "\[IndentingNewLine]", "Null"}], "\[IndentingNewLine]", "]"}]}], 
   "\[IndentingNewLine]", ")"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Assert", "[", 
    RowBox[{"LogTest`test_", " ", "/;", " ", 
     RowBox[{"LogTest`test", " ", "\[Element]", " ", "Booleans"}]}], "]"}], ":=",
    "\[IndentingNewLine]", " ", 
   RowBox[{"(", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"LogTest`finish", " ", "=", " ", 
      RowBox[{"AbsoluteTime", "[", "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"LogTest`testtime", " ", "=", " ", 
      RowBox[{"LogTest`finish", " ", "-", " ", "LogTest`start"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{"LogTest`test", ",", 
       RowBox[{
        RowBox[{"LogTest`result", " ", "=", " ", "\"\<pass\>\""}], ";"}], ",", 
       RowBox[{
        RowBox[{"LogTest`result", " ", "=", " ", "\"\<fail\>\""}], ";"}]}], 
      "]"}], ";", "\[IndentingNewLine]", 
     RowBox[{"LogTest`strResult", " ", "=", " ", 
      RowBox[{"StringForm", "[", 
       RowBox[{"\"\< -- (`1` seconds)...`2`\>\"", ",", " ", 
        RowBox[{"Round", "[", 
         RowBox[{"LogTest`testtime", ",", ".01"}], "]"}], ",", " ", 
        "LogTest`result"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Print", "[", 
      RowBox[{
      "\"\<The test named: \>\"", ",", "LogTest`strTestName", ",", " ", 
       "LogTest`strResult"}], "]"}], ";", "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{"LogTest`testLoggingEnabled", ",", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"LogTest`os", " ", "=", 
         RowBox[{"OpenAppend", "[", "LogTest`fn", "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"WriteString", "[", 
         RowBox[{"LogTest`os", ",", "LogTest`strResult", ",", "\"\<\\n\>\""}],
          "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"Close", "[", "LogTest`os", "]"}], ";"}], ",", 
       "\[IndentingNewLine]", "Null"}], "\[IndentingNewLine]", "]"}]}], 
    "\[IndentingNewLine]", ")"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Message", "[", "LogTest`messageText_String", "]"}], ":=", 
   "\[IndentingNewLine]", 
   RowBox[{"(", "\[IndentingNewLine]", 
    RowBox[{"If", "[", 
     RowBox[{"LogTest`testLoggingEnabled", ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"LogTest`os", " ", "=", 
        RowBox[{"OpenAppend", "[", "LogTest`fn", "]"}]}], ";", 
       "\[IndentingNewLine]", 
       RowBox[{"WriteString", "[", 
        RowBox[{
        "LogTest`os", ",", "LogTest`messageText", ",", "\"\<\\n\>\""}], "]"}],
        ";", "\[IndentingNewLine]", 
       RowBox[{"Close", "[", "LogTest`os", "]"}], ";"}], ",", 
      "\[IndentingNewLine]", "Null"}], "\[IndentingNewLine]", "]"}], 
    "\[IndentingNewLine]", ")"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`TallyTests", "[", "]"}], ":=", "\[IndentingNewLine]", 
   RowBox[{"(", "\[IndentingNewLine]", 
    RowBox[{"If", "[", 
     RowBox[{"LogTest`testLoggingEnabled", ",", "\[IndentingNewLine]", 
      RowBox[{"(", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"LogTest`ss", "=", 
         RowBox[{"StringJoin", "[", 
          RowBox[{"ReadList", "[", 
           RowBox[{"LogTest`fn", ",", "String"}], "]"}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"LogTest`totals", " ", "=", " ", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"StringCount", "[", 
            RowBox[{"LogTest`ss", ",", "\"\<...\>\""}], "]"}], ",", 
           RowBox[{"StringCount", "[", 
            RowBox[{"LogTest`ss", ",", "\"\<...pass\>\""}], "]"}], ",", 
           RowBox[{"StringCount", "[", 
            RowBox[{"LogTest`ss", ",", "\"\<...fail\>\""}], "]"}]}], "}"}]}], 
        ";", "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"LogTest`totals", "[", 
            RowBox[{"[", "3", "]"}], "]"}], " ", "==", "0"}], ",", " ", 
          RowBox[{"LogTest`str", "=", "\"\<Success!\\n\>\""}], ",", " ", 
          RowBox[{"LogTest`str", " ", "=", " ", "\"\<Failure!!\\n\>\""}]}], 
         "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"LogTest`str", " ", "=", " ", 
         RowBox[{"LogTest`str", " ", "<>", " ", 
          RowBox[{"ToString", "[", 
           RowBox[{
            RowBox[{
             RowBox[{"StringForm", "[", 
              RowBox[{
              "\"\<`1` total tests `2` tests passed `3` tests failed\>\"", 
               ",", "#1", " ", ",", "#2", ",", "#3"}], "]"}], "&"}], " ", "@@",
             "LogTest`totals"}], "]"}]}]}]}], "\[IndentingNewLine]", ")"}], 
      ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"Print", "[", "\"\<Test Logging not enabled\>\"", "]"}], 
       ";"}]}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", ")"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`testLoggingEnabled", " ", "=", "True"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Setup", "[", "]"}], "\[IndentingNewLine]", 
 RowBox[{"Names", "[", "\"\<Global`*\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"Names", "[", "\"\<LogTest`*\>\"", "]"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.409499477211851*^9, 3.409499477452197*^9}, {
   3.409499539441333*^9, 3.4094995410336227`*^9}, 3.4095003533516784`*^9, {
   3.4095003934593506`*^9, 3.409500438884669*^9}, {3.4151261806903367`*^9, 
   3.4151261881210213`*^9}, {3.4151262296707673`*^9, 3.415126271751276*^9}, {
   3.4221192427434497`*^9, 3.422119261250061*^9}, 3.4221198029790287`*^9, 
   3.4221223978001986`*^9, {3.444587633953125*^9, 3.444587711015625*^9}, {
   3.444587790109375*^9, 3.444587797125*^9}, {3.444587837203125*^9, 
   3.444587860015625*^9}, 3.444587912234375*^9, {3.4445881898125*^9, 
   3.444588270296875*^9}, {3.444588416484375*^9, 3.444588430328125*^9}, {
   3.44458853053125*^9, 3.4445885424375*^9}, {3.44458867715625*^9, 
   3.44458868021875*^9}, {3.512504027734375*^9, 3.512504057125*^9}, {
   3.51250410625*^9, 3.512504106921875*^9}, {3.5125041550625*^9, 
   3.5125042*^9}, {3.512504238078125*^9, 3.51250423859375*^9}, {
   3.512504280296875*^9, 3.5125042866875*^9}, 3.512504734859375*^9, {
   3.5125047651875*^9, 3.51250477359375*^9}, {3.512504813546875*^9, 
   3.512504916046875*^9}, {3.512504954953125*^9, 3.512505016015625*^9}, {
   3.512505082515625*^9, 3.512505084890625*^9}, 3.512505483921875*^9, {
   3.512505688265625*^9, 3.512505718546875*^9}, {3.51250619025*^9, 
   3.5125062301875*^9}, {3.512506295875*^9, 3.512506296515625*^9}, {
   3.5125070884375*^9, 3.51250711584375*^9}, {3.512520879484375*^9, 
   3.512520883546875*^9}, {3.512589287921875*^9, 3.51258930071875*^9}, {
   3.512589348453125*^9, 3.512589450859375*^9}, {3.51258950628125*^9, 
   3.512589516875*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Loading from AddOns directory", "Subtitle",
 CellChangeTimes->{{3.409504746608872*^9, 3.4095047490523853`*^9}, {
  3.4151260430023513`*^9, 3.4151260473886585`*^9}}],

Cell["\<\
This use of needs calls the package in the AddOns\\ExtraPackages directory.  \
If DAQTesting is defined the executable should be with the package in the DAQ \
directory.  If DAQTesting is not defined set directory to desired location \
before calling Needs.  The directory returned is the directory of the \
executable that is being linked.
Note: not test from command line\
\>", "Text",
 CellChangeTimes->{
  3.4094964807831984`*^9, {3.40949662913652*^9, 3.409496650737581*^9}, {
   3.409496725254731*^9, 3.4094967789719725`*^9}, 3.409498835168638*^9, {
   3.40949888613192*^9, 3.4094989780641117`*^9}, {3.4151263101565*^9, 
   3.41512633444142*^9}, {3.422119010639701*^9, 3.4221190596802177`*^9}}],

Cell[BoxData[
 RowBox[{"(*", "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"Needs", "[", "\"\<DAQ`DataAcquisition`\>\"", "]"}], "\n", 
   RowBox[{"Needs", "[", "\"\<ErrorBarPlots`\>\"", "]"}]}], 
  "\[IndentingNewLine]", "*)"}]], "Input",
 CellChangeTimes->{{3.4094962499312496`*^9, 3.4094962866139965`*^9}, {
  3.409496388620675*^9, 3.4094963949497757`*^9}, {3.409496658048093*^9, 
  3.4094966648979425`*^9}, {3.4094967855314045`*^9, 3.4094967945343504`*^9}, {
  3.409497706836176*^9, 3.4094977177618866`*^9}, {3.4094993279071617`*^9, 
  3.409499335247717*^9}, {3.4151263375058265`*^9, 3.4151263648251095`*^9}}],

Cell[BoxData[
 RowBox[{"(*", "\[IndentingNewLine]", 
  RowBox[{"ListPlot", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", "10000.`", ",", "500"}], "]"}], "}"}], 
    ",", 
    RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}], "\[IndentingNewLine]", 
  "*)"}]], "Input",
 CellChangeTimes->{{3.409499477211851*^9, 3.409499477452197*^9}, {
   3.409499539441333*^9, 3.4094995410336227`*^9}, 3.4095003533516784`*^9, {
   3.4095003934593506`*^9, 3.409500438884669*^9}, {3.415126211985337*^9, 
   3.4151262249239416`*^9}, {3.4151263172867527`*^9, 3.415126323746041*^9}, {
   3.4151263678094006`*^9, 3.4151263849840965`*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Loading from parent notebook directory", "Subtitle",
 InitializationCell->True,
 CellChangeTimes->{3.4119215337837777`*^9, 3.411921586870112*^9}],

Cell["\<\
The following loads the package file from the directory where the parent \
notebook creates the package.  Should probably be what is used while \
debugging or changing package code.  The set directory commadns selects which \
exectuable is linked.
Need to fix package to allow closing link and reopening easily.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4082088547428784`*^9, 3.4082088680620303`*^9}, {
   3.4082091082373857`*^9, 3.4082091276352787`*^9}, {3.4082094768674498`*^9, 
   3.4082095033955956`*^9}, {3.409500485882248*^9, 3.4095005120398607`*^9}, 
   3.4119215337837777`*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"DAQTesting", " ", "=", " ", "True"}], ";", "  ", 
   RowBox[{"(*", " ", 
    RowBox[{"set", " ", "to", " ", "anyvalue", " ", "for", " ", "now"}], " ", 
    "*)"}], "\[IndentingNewLine]", 
   RowBox[{"exeDirDefault", " ", "=", 
    RowBox[{"ToFileName", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"ParentDirectory", "[", 
        RowBox[{"ParentDirectory", "[", "basedir", "]"}], "]"}], ",", 
       "\"\<build_MinGW\>\"", ",", "\"\<Debug\>\""}], "}"}], "]"}]}], ";"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "exeDir", " ", "may", " ", "be", " ", "set", " ", "from", " ", "command", 
    " ", "line", " ", "when", " ", "testing"}], " ", "*)"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"exeDir", " ", "=", "  ", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"ValueQ", "[", "exeDir", "]"}], ",", "\[IndentingNewLine]", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"Print", "[", 
        RowBox[{
        "\"\<Using choosen executable directory: \>\"", ",", "exeDir"}], 
        "]"}], ";", " ", "exeDir"}], ")"}], ",", "\[IndentingNewLine]", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"Print", "[", 
        RowBox[{
        "\"\<Using default executabe directory: \>\"", ",", " ", 
         "exeDirDefault"}], "]"}], ";", "exeDirDefault"}], ")"}]}], 
    "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"SetDirectory", "[", "exeDir", "]"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Message", "[", 
  "\"\<The executable file called is in the following directory\>\"", 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Message", "[", 
  RowBox[{"ToString", "[", "exeDir", "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Message", "[", "\"\<***\>\"", "]"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", "\"\<Checking that the link is established\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t1", "=", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Needs", "[", 
   RowBox[{"\"\<DAQ`DataAcquisition`\>\"", ",", 
    RowBox[{"ToFileName", "[", 
     RowBox[{
      RowBox[{"ParentDirectory", "[", "basedir", "]"}], ",", 
      "\"\<DataAcquisition.m\>\""}], "]"}]}], "]"}], "\n", 
  RowBox[{"(*", " ", 
   RowBox[{"or", "  ", 
    RowBox[{
    "<<", "\"\<C:\\\\math\\\\mathDAQ\\\\Package\\\\DataAcquisition.m\>\""}]}],
    " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{"\"\<Time needed to establish the link by itself: \>\"", ",", " ", 
    RowBox[{
     RowBox[{"AbsoluteTime", "[", "]"}], " ", "-", " ", "t1"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetDirectory", "[", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Needs", "[", "\"\<ErrorBarPlots`\>\"", "]"}], "\n", 
  RowBox[{"(*", " ", 
   RowBox[{"Links", "[", "\"\<getvolt*\>\"", "]"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "DAQTesting", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"theLink", "=", 
  RowBox[{"Links", "[", "\"\<mathDAQ*\>\"", "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{
    RowBox[{"Length", "[", "theLink", "]"}], " ", "\[Equal]", "1"}], "]"}], 
  ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4041520955675983`*^9, 3.4041520993930993`*^9}, 
   3.404152169513928*^9, {3.404153255825968*^9, 3.4041532594411664`*^9}, {
   3.4081987063101487`*^9, 3.4081987183975296`*^9}, {3.4082084802543907`*^9, 
   3.4082085485826416`*^9}, {3.408208715102085*^9, 3.408208716954749*^9}, {
   3.408209149636915*^9, 3.408209155014648*^9}, {3.4082093337316303`*^9, 
   3.408209342033568*^9}, {3.409270541517*^9, 3.4092705418374605`*^9}, {
   3.4094980201266656`*^9, 3.40949809173964*^9}, {3.4094990095193424`*^9, 
   3.4094990169099693`*^9}, {3.409499220002002*^9, 3.4094992534000254`*^9}, 
   3.4104629898076367`*^9, {3.4104630754908433`*^9, 3.4104630760416355`*^9}, {
   3.411658488679208*^9, 3.411658491403125*^9}, {3.411659494155011*^9, 
   3.411659580659398*^9}, 3.4116599878949747`*^9, {3.4119214957691154`*^9, 
   3.4119215337837777`*^9}, {3.4151264210759945`*^9, 
   3.4151265336178217`*^9}, {3.415126581015977*^9, 3.41512664989502*^9}, {
   3.422107604338245*^9, 3.4221076119491887`*^9}, {3.4221198055827727`*^9, 
   3.422119806514112*^9}, {3.4445853244375*^9, 3.444585328875*^9}, {
   3.444585518546875*^9, 3.444585524171875*^9}, {3.444586842609375*^9, 
   3.44458685303125*^9}, {3.4445870070625*^9, 3.4445870085*^9}, {
   3.444587978875*^9, 3.444588041265625*^9}, {3.444588098796875*^9, 
   3.444588113109375*^9}, {3.444588781421875*^9, 3.4445888714375*^9}, {
   3.44458896528125*^9, 3.4445889725625*^9}, {3.446824864625*^9, 
   3.446824869796875*^9}, {3.4468249713125*^9, 3.44682500390625*^9}, {
   3.447266630359375*^9, 3.44726666375*^9}, {3.473527809710053*^9, 
   3.473527811319562*^9}, {3.4735278554326067`*^9, 3.47352785588577*^9}, {
   3.4735334945110817`*^9, 3.473533503355115*^9}, {3.473534648494173*^9, 
   3.4735347099172277`*^9}, {3.473534774215337*^9, 3.4735347798716955`*^9}, {
   3.473534817919301*^9, 3.4735348357008924`*^9}, {3.51232020603125*^9, 
   3.512320206046875*^9}, {3.512320252484375*^9, 3.5123202893125*^9}, {
   3.512320373703125*^9, 3.512320374171875*^9}, {3.512320412875*^9, 
   3.512320439015625*^9}, {3.512320520234375*^9, 3.512320589375*^9}, {
   3.512320750640625*^9, 3.512320916328125*^9}, {3.512321024796875*^9, 
   3.51232114640625*^9}, {3.512321195296875*^9, 3.5123212191875*^9}, {
   3.5123213205625*^9, 3.512321357125*^9}, {3.512321459765625*^9, 
   3.512321459875*^9}, {3.512478331609375*^9, 3.512478361625*^9}, 
   3.5124785535625*^9, {3.51247865371875*^9, 3.51247865815625*^9}, 
   3.512478689140625*^9, {3.51247875659375*^9, 3.51247876015625*^9}, {
   3.512482436953125*^9, 3.51248244378125*^9}, {3.512487558171875*^9, 
   3.512487590015625*^9}, {3.51250676453125*^9, 3.512506840109375*^9}, {
   3.512506879640625*^9, 3.512506883703125*^9}, {3.51250692475*^9, 
   3.51250693309375*^9}, {3.512507065453125*^9, 3.512507065859375*^9}, {
   3.51767078890625*^9, 3.517670835546875*^9}, {3.517670908046875*^9, 
   3.517670984765625*^9}, {3.517671068015625*^9, 3.51767108225*^9}, {
   3.517671190453125*^9, 3.517671201734375*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Information on available functions", "Subtitle",
 CellChangeTimes->{
  3.4092706984526625`*^9, {3.4119222398991213`*^9, 3.4119222490522833`*^9}, {
   3.412443017093197*^9, 3.4124430212491727`*^9}}],

Cell["Note all the symbols in the global namespace", "Text",
 CellChangeTimes->{
  3.4092706984526625`*^9, {3.4119222398991213`*^9, 3.4119222490522833`*^9}, {
   3.412443017093197*^9, 3.4124430464954753`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"?", "DAQ`DataAcquisition`*"}], "\n", 
 RowBox[{"?", "RunTask"}], "\n", 
 RowBox[{"?", "GetVoltages"}], "\n", 
 RowBox[{"?", "GetVoltagesTrig"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Options", "[", "GetVoltagesTrig", "]"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{
   "this", " ", "is", " ", "default", " ", "options", " ", "not", " ", "all", 
    " ", "options"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{"?", "GetVoltagesDigTrig"}], "\n", 
 RowBox[{"?", "OutputVoltage"}], "\n", 
 RowBox[{"?", "OutputWaveform"}], "\n", 
 RowBox[{"?", "ClearTask"}], "\n", 
 RowBox[{"?", "ReDoLink"}], "\[IndentingNewLine]", 
 RowBox[{"?", "SerialPortCommunicateCpp"}], "\n", 
 RowBox[{"?", "SerialPortCommunicateCpp"}]}], "Input",
 CellChangeTimes->{{3.4095031931851587`*^9, 3.4095032043712435`*^9}, {
   3.4095032507980013`*^9, 3.4095032755035267`*^9}, {3.4095033704400387`*^9, 
   3.409503436755395*^9}, {3.409504177480506*^9, 3.4095041794333134`*^9}, 
   3.4095042173077745`*^9, {3.409504502347642*^9, 3.4095045156467648`*^9}, {
   3.409504550006171*^9, 3.409504562844632*^9}, {3.412437882810461*^9, 
   3.4124378841323614`*^9}, {3.4124421765745907`*^9, 
   3.4124422437011137`*^9}, {3.412442430459659*^9, 3.4124424413152685`*^9}, {
   3.4124425109053345`*^9, 3.4124425207595043`*^9}, {3.4124425533864193`*^9, 
   3.4124426179993277`*^9}, 3.412442681610797*^9, {3.4124427847991743`*^9, 
   3.4124428025346766`*^9}, {3.41244289019072*^9, 3.4124429515890064`*^9}, {
   3.447602265125*^9, 3.447602279171875*^9}, {3.447602350421875*^9, 
   3.4476023735*^9}}],

Cell[BoxData[
 RowBox[{"?", "Global`*"}]], "Input",
 CellChangeTimes->{{3.4095031931851587`*^9, 3.4095032043712435`*^9}, {
   3.4095032507980013`*^9, 3.4095032755035267`*^9}, {3.4095033704400387`*^9, 
   3.409503436755395*^9}, {3.409504177480506*^9, 3.4095041794333134`*^9}, 
   3.4095042173077745`*^9, {3.409504502347642*^9, 3.4095045156467648`*^9}, {
   3.409504550006171*^9, 3.409504562844632*^9}, {3.412437882810461*^9, 
   3.4124378841323614`*^9}, {3.4124421765745907`*^9, 
   3.4124422437011137`*^9}, {3.412442430459659*^9, 3.4124424413152685`*^9}, {
   3.4124425109053345`*^9, 3.4124425207595043`*^9}, {3.4124425533864193`*^9, 
   3.4124426179993277`*^9}, 3.412442681610797*^9, {3.4124427847991743`*^9, 
   3.4124428025346766`*^9}, {3.41244289019072*^9, 3.412442954102621*^9}}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["Quick test of GetVoltage", "Subtitle",
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.411922350337925*^9, 3.411922354974592*^9}, {
   3.4119223922582035`*^9, 3.4119224156618557`*^9}}],

Cell[BoxData[
 RowBox[{"ListPlot", "[", 
  RowBox[{
   RowBox[{"GetVoltages", "[", 
    RowBox[{
     RowBox[{"{", "0", "}"}], ",", "10000.0", ",", "600", ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}], ",", 
   RowBox[{"Joined", "\[Rule]", "True"}], ",", 
   RowBox[{"Mesh", "\[Rule]", "All"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.411922350337925*^9, 3.411922354974592*^9}, {
   3.4128032576598177`*^9, 3.4128032592120495`*^9}, {3.44682526771875*^9, 
   3.446825268*^9}, {3.4487389371483307`*^9, 3.448738937617075*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Outputing Single Samples", "Subtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 
   3.4119226353978205`*^9}, {3.411922776110155*^9, 3.411922776510731*^9}, {
   3.415132683641121*^9, 3.4151326891189976`*^9}}],

Cell["\<\
Outputting simple sample in either immediate or setup only mode.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 
   3.4119226353978205`*^9}, {3.411922776110155*^9, 3.411922776510731*^9}, {
   3.415132683641121*^9, 3.415132746992215*^9}}],

Cell[CellGroupData[{

Cell["Outputing on one channel Immediate", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, {
   3.411922787596672*^9, 3.4119228245898657`*^9}, {3.4124284081265345`*^9, 
   3.412428416899149*^9}, {3.4124290757965965`*^9, 3.4124290823159714`*^9}}],

Cell["\<\
Remember to test the combinations of transfer mechanisms
Should tests be in their own namespace?
First output on channel 0 and then on channel 1.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, {
   3.411922787596672*^9, 3.4119228245898657`*^9}, {3.4124284081265345`*^9, 
   3.4124284814319425`*^9}, {3.4124289443976545`*^9, 
   3.4124289746711855`*^9}, {3.412429190671779*^9, 3.4124292170897665`*^9}}],

Cell[BoxData[{
 RowBox[{"LogTest`TestName", "[", 
  "\"\<Outputting a single voltage on Channel 0\>\"", 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"volt", " ", "=", "1.0"}], ";", 
  RowBox[{"answer", " ", "=", "0"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", "0", "}"}], ",", 
    RowBox[{"{", "volt", "}"}], ",", "1", ",", "1"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", " ", "=", 
   RowBox[{"Mean", "[", 
    RowBox[{"GetVoltages", "[", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", "1000", ",", "100", ",", 
      RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", "0", "}"}], ",", 
    RowBox[{"{", "0", "}"}], ",", "1", ",", "1"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Print", "[", " ", 
    RowBox[{"\"\<Output channel 0 error in volt is: \>\"", ",", 
     RowBox[{"volt", "-", "answer"}], ",", " ", "\"\< Volts\>\""}], "]"}], 
   ";"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"LogTest`Test", "[", 
     RowBox[{"\"\<Outputting a single voltage on channel 0\>\"", ",", 
      RowBox[{
       RowBox[{"Abs", "[", 
        RowBox[{"volt", "-", "answer"}], "]"}], " ", "\[LessEqual]", 
       ".02"}]}], "]"}], ";"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Assert", "[", 
    RowBox[{
     RowBox[{"Abs", "[", 
      RowBox[{"volt", "-", "answer"}], "]"}], " ", "\[LessEqual]", ".02"}], 
    "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`TestName", "[", 
  "\"\<Outputting a single voltage on Channel 1\>\"", "]"}], "\n", 
 RowBox[{
  RowBox[{"volt", " ", "=", "2.0"}], ";", 
  RowBox[{"answer", " ", "=", "0"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", "1", "}"}], ",", 
    RowBox[{"{", "volt", "}"}], ",", "1", ",", "1"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", " ", "=", 
   RowBox[{"Mean", "[", 
    RowBox[{"GetVoltages", "[", 
     RowBox[{
      RowBox[{"{", "3", "}"}], ",", "1000", ",", "100", ",", 
      RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", "1", "}"}], ",", 
    RowBox[{"{", "0", "}"}], ",", "1", ",", "1", ",", " ", 
    RowBox[{"MessageLevel", " ", "\[Rule]", " ", "0"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", " ", 
   RowBox[{"\"\<Output channel 1 error in volt is: \>\"", ",", 
    RowBox[{"volt", "-", "answer"}], ",", " ", "\"\< Volts\>\""}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{
    RowBox[{"Abs", "[", 
     RowBox[{"volt", "-", "answer"}], "]"}], " ", "\[LessEqual]", ".02"}], 
   "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228355756626`*^9}, {
   3.411923100476571*^9, 3.411923256070304*^9}, {3.4119238454077296`*^9, 
   3.41192385107588*^9}, 3.4124283925641565`*^9, {3.4124288320060434`*^9, 
   3.412428847358118*^9}, {3.415126767944767*^9, 3.4151267700578055`*^9}, {
   3.415126991776622*^9, 3.4151270065478616`*^9}, {3.4151274524390216`*^9, 
   3.4151276570332136`*^9}, {3.4161504558668957`*^9, 
   3.4161504592818065`*^9}, {3.4161505778022304`*^9, 3.416150580606262*^9}, {
   3.4161506249500256`*^9, 3.4161506278241587`*^9}, {3.4850122464375*^9, 
   3.485012246890625*^9}, {3.48501241353125*^9, 3.485012413765625*^9}, {
   3.48501245321875*^9, 3.4850124821875*^9}, {3.5125051919375*^9, 
   3.512505294140625*^9}, {3.51250646903125*^9, 3.512506476453125*^9}, {
   3.5125065744375*^9, 3.512506598953125*^9}, {3.5125066728125*^9, 
   3.512506679984375*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Outputting on two channels Immeditate", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.411922883865099*^9}, {
   3.4124286256893744`*^9, 3.412428631968403*^9}, {3.4124286897314625`*^9, 
   3.4124286977429824`*^9}, {3.4124287361482067`*^9, 
   3.4124287428578544`*^9}, {3.4124290873532143`*^9, 3.4124290905077505`*^9}}],

Cell["\<\
Output a single sample to two channel at the same time.  Note the data is a \
list of lists\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.411922883865099*^9}, {
   3.4124286256893744`*^9, 3.412428631968403*^9}, {3.4124286897314625`*^9, 
   3.4124286977429824`*^9}, {3.4124287361482067`*^9, 
   3.4124288041059246`*^9}, {3.412428858934765*^9, 3.4124288769306417`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Outputting a voltages on channels 0 and 1\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"volt0", " ", "=", "2.4"}], ";", 
  RowBox[{"volt1", "=", 
   RowBox[{"-", "1.78"}]}], ";", 
  RowBox[{"Clear", "[", "answer", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"OutputWaveform", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"0", ",", " ", "1"}], "}"}], ",", " ", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", "volt0", "}"}], ",", 
     RowBox[{"{", "volt1", "}"}]}], "}"}], ",", " ", "1", ",", " ", "1", ",", 
   " ", 
   RowBox[{"MessageLevel", " ", "\[Rule]", " ", "0"}]}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", "=", 
   RowBox[{"Mean", "[", 
    RowBox[{"Transpose", "[", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", "3"}], "}"}], ",", "60", ",", "10", ",", 
       RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", " ", 
   RowBox[{"\"\<Output errors:\\nChannel 0 = \>\"", ",", 
    RowBox[{"volt0", "-", 
     RowBox[{"answer", "[", 
      RowBox[{"[", 
       RowBox[{"0", "+", "1"}], "]"}], "]"}]}], ",", " ", "\"\< Volts\\n\>\"",
     ",", "\"\<Channel 1 = \>\"", ",", 
    RowBox[{"volt1", " ", "-", 
     RowBox[{"answer", "[", 
      RowBox[{"[", 
       RowBox[{"1", "+", "1"}], "]"}], "]"}]}], ",", " ", "\"\< Volts\>\""}], 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", 
      RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1", ",", " ", 
    RowBox[{"MessageLevel", " ", "\[Rule]", " ", "0"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"(", 
      RowBox[{"Abs", "[", 
       RowBox[{"volt0", "-", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"0", "+", "1"}], "]"}], "]"}]}], "]"}], ")"}], " ", 
     "\[LessEqual]", " ", "0.02"}], " ", "&&", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"Abs", "[", 
       RowBox[{"volt1", " ", "-", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"1", "+", "1"}], "]"}], "]"}]}], "]"}], " ", "\[LessEqual]",
       " ", "0.02"}], ")"}]}], "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.412429983652029*^9}, {
   3.415127698082239*^9, 3.415128002570071*^9}, {3.512507252140625*^9, 
   3.512507364265625*^9}, {3.5125202764375*^9, 3.5125202831875*^9}, {
   3.51252099428125*^9, 3.51252099471875*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Outputting on two channels repeatedly using Immediate transfer\
\>", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.411922883865099*^9}, {
   3.4124286256893744`*^9, 3.412428631968403*^9}, {3.4124286897314625`*^9, 
   3.4124286977429824`*^9}, {3.4124287361482067`*^9, 
   3.4124287428578544`*^9}, {3.4124290873532143`*^9, 
   3.4124290905077505`*^9}, {3.4124301842104177`*^9, 3.412430214503978*^9}, {
   3.4222055327311664`*^9, 3.422205534493701*^9}}],

Cell["\<\
This method works but is not recommended as it is very slow since slow \
indentical setup is preformed every time for both reading and writing.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.412430121279928*^9}, {
   3.4124302170776787`*^9, 3.412430266498742*^9}, {3.412431974985426*^9, 
   3.412431988464808*^9}}],

Cell[BoxData[{
 RowBox[{"LogTest`TestName", "[", 
  "\"\<Outputting repeatedly using slow IMMEDIATE transfer on channels 0 and \
1\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "answer", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"inputData", " ", "=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"5.0", "*", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"Sin", "[", "x", "]"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"Cos", "[", "x", "]"}], "}"}]}], "}"}]}], "//", "N"}], ",", 
     RowBox[{"{", 
      RowBox[{"x", ",", "0", ",", 
       RowBox[{
        RowBox[{"2", "*", "Pi"}], "-", 
        RowBox[{"2", "*", 
         RowBox[{"Pi", "/", "100"}]}]}], ",", 
       RowBox[{"2", "*", 
        RowBox[{"Pi", "/", "50"}]}]}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", " ", "=", 
   RowBox[{"Table", " ", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{"OutputWaveform", "[", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"0", ",", "1"}], "}"}], ",", "p", ",", "10", ",", "10"}], 
         "]"}], ",", 
        RowBox[{"GetVoltages", "[", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"0", ",", "3"}], "}"}], ",", "100", ",", "1", ",", 
          RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}]}], "}"}], "[", 
      RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
     RowBox[{"{", 
      RowBox[{"p", ",", "inputData"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"ListPlot", "[", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"Take", "[", 
     RowBox[{
      RowBox[{"Flatten", "[", 
       RowBox[{"inputData", ",", "2"}], "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"1", ",", 
        RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "]"}], ",", 
    RowBox[{"Take", "[", 
     RowBox[{
      RowBox[{"Flatten", "[", 
       RowBox[{"answer", ",", "2"}], "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"1", ",", 
        RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "]"}]}], "}"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`pointsInError", " ", "=", " ", 
  RowBox[{"Count", "[", 
   RowBox[{
    RowBox[{"Abs", "[", 
     RowBox[{
      RowBox[{"Flatten", "[", 
       RowBox[{"inputData", ",", "2"}], "]"}], "-", " ", 
      RowBox[{"Flatten", "[", 
       RowBox[{"answer", ",", "2"}], "]"}]}], "]"}], ",", 
    RowBox[{"x_", " ", "/;", " ", 
     RowBox[{"x", "\[GreaterEqual]", " ", ".02"}]}]}], 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", 
      RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1", ",", " ", 
    RowBox[{"MessageLevel", " ", "\[Rule]", " ", "0"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{"LogTest`pointsInError", " ", "\[Equal]", "0"}], "]"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.412707506905128*^9}, {3.415128905518447*^9, 3.415128930023684*^9}, 
   3.415128974287332*^9, 3.415129680572921*^9, {3.4151301431781144`*^9, 
   3.415130170176937*^9}, {3.415131003004484*^9, 3.4151310789937515`*^9}, 
   3.4151311219955845`*^9, {3.4151311533306427`*^9, 3.4151311682320695`*^9}, {
   3.4151312240623493`*^9, 3.4151312909284983`*^9}, {3.41513197671461*^9, 
   3.415131977155244*^9}, {3.415132018895263*^9, 3.415132048788247*^9}, {
   3.4151320957057114`*^9, 3.415132151886495*^9}, {3.44881137865625*^9, 
   3.448811394046875*^9}, {3.448811427453125*^9, 3.448811428046875*^9}, {
   3.448811474328125*^9, 3.448811481828125*^9}, {3.51252032303125*^9, 
   3.51252039153125*^9}, {3.51252074971875*^9, 3.51252078075*^9}, {
   3.512520987671875*^9, 3.512520988140625*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Outputting one or two channel one sample repeatedly using Setup only option\
\>", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075406436415`*^9}, {3.4127075966541805`*^9, 
   3.4127076180749826`*^9}, {3.412707689337453*^9, 3.4127076938739758`*^9}, {
   3.4127092586239758`*^9, 3.412709270130522*^9}}],

Cell["\<\
This method works but is recommended when mthematica must do computation of \
value to send each time.  However, the timing is not consistent as the PC is \
woirking on other tasks as well so loop time varies.  Note the irratating \
asymmetry between OutputWaveForm which take data as list of list \
{{Real},{Real}} and RunTask which needs a list {Real,Real}!\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075406436415`*^9}, {3.4127076234326863`*^9, 
   3.4127076366016226`*^9}, {3.412707666985312*^9, 3.4127077234264708`*^9}, {
   3.412708480054448*^9, 3.4127085387588606`*^9}, {3.4127100354509983`*^9, 
   3.412710044634203*^9}, {3.4127129874958305`*^9, 3.4127130994067507`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Using setup only option to ouput single voltage on channel 0\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"volt", " ", "=", "1.80"}], ";", 
  RowBox[{"answer", " ", "=", "0"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thWrite", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", "0", "}"}], ",", 
     RowBox[{"{", "0.0", "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", " ", "->", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite", ",", "volt"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", "=", 
   RowBox[{"Mean", "[", 
    RowBox[{"GetVoltages", "[", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", "60", ",", "10", ",", 
      RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Print", "[", " ", 
    RowBox[{"\"\<Output channel 0 error in volt is: \>\"", ",", 
     RowBox[{"volt", "-", "answer"}], ",", " ", "\"\< Volts\>\""}], "]"}], 
   ";"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"LogTest`Test", "[", 
     RowBox[{
     "\"\<Using setup only option to ouput single voltage on channel 0\>\"", 
      ",", 
      RowBox[{
       RowBox[{"Abs", "[", 
        RowBox[{"volt", "-", "answer"}], "]"}], " ", "\[LessEqual]", 
       ".02"}]}], "]"}], ";"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite", ",", "0.0"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{
    RowBox[{"Abs", "[", 
     RowBox[{"volt", "-", "answer"}], "]"}], " ", "\[LessEqual]", ".02"}], 
   "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.412708054542592*^9}, {3.412708549784715*^9, 
   3.4127085651968765`*^9}, {3.4127085977136335`*^9, 
   3.4127086150185165`*^9}, {3.412710163144613*^9, 3.4127103918935375`*^9}, 
   3.4127104329225345`*^9, {3.412710466661048*^9, 3.4127105391552896`*^9}, {
   3.412710586483344*^9, 3.412710587635*^9}, {3.412710812808784*^9, 
   3.4127108363526382`*^9}, {3.4127109118111424`*^9, 
   3.4127109119313154`*^9}, {3.415131358645871*^9, 3.415131405132716*^9}, {
   3.51252097584375*^9, 3.51252098175*^9}, {3.512521056984375*^9, 
   3.512521084359375*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Using setup only option to ouput on two channels\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"volt0", " ", "=", 
   RowBox[{"-", "1.8"}]}], ";", 
  RowBox[{"volt1", "=", 
   RowBox[{"-", "0.78"}]}], ";", 
  RowBox[{"Clear", "[", "answer", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", " ", "1"}], "}"}], ",", " ", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "volt0", "}"}], ",", 
      RowBox[{"{", "volt1", "}"}]}], "}"}], ",", " ", "1", ",", " ", "1", ",",
     " ", 
    RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", 
    RowBox[{"MessageLevel", " ", "\[Rule]", " ", "0"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite", ",", 
    RowBox[{"{", 
     RowBox[{"volt0", ",", "volt1"}], "}"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", "=", 
   RowBox[{"Mean", "[", 
    RowBox[{"Transpose", "[", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", "3"}], "}"}], ",", "60", ",", "10", ",", 
       RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", " ", 
   RowBox[{"\"\<Output errors:\\nChannel 0 = \>\"", ",", 
    RowBox[{"volt0", "-", 
     RowBox[{"answer", "[", 
      RowBox[{"[", 
       RowBox[{"0", "+", "1"}], "]"}], "]"}]}], ",", " ", "\"\< Volts\\n\>\"",
     ",", "\"\<Channel 1 = \>\"", ",", 
    RowBox[{"volt1", " ", "-", 
     RowBox[{"answer", "[", 
      RowBox[{"[", 
       RowBox[{"1", "+", "1"}], "]"}], "]"}]}], ",", " ", "\"\< Volts\>\""}], 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite", ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"(", 
      RowBox[{"Abs", "[", 
       RowBox[{"volt0", "-", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"0", "+", "1"}], "]"}], "]"}]}], "]"}], ")"}], " ", 
     "\[LessEqual]", " ", "0.02"}], " ", "&&", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"Abs", "[", 
       RowBox[{"volt1", " ", "-", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"1", "+", "1"}], "]"}], "]"}]}], "]"}], " ", "\[LessEqual]",
       " ", "0.02"}], ")"}]}], "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.412708054542592*^9}, {3.412708549784715*^9, 
   3.4127085651968765`*^9}, {3.4127085977136335`*^9, 
   3.4127086150185165`*^9}, {3.412710163144613*^9, 3.412710282996952*^9}, {
   3.412710603137291*^9, 3.412710675731677*^9}, {3.4127107083485775`*^9, 
   3.4127108010018063`*^9}, {3.415131445961425*^9, 3.4151315018918486`*^9}, {
   3.5125211409375*^9, 3.51252119909375*^9}, {3.51252129765625*^9, 
   3.512521302890625*^9}, {3.5125213545625*^9, 3.5125213549375*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Using Setup Only for both Reading and write channels of data", \
"Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.412708054542592*^9}, {3.412708549784715*^9, 
   3.4127085651968765`*^9}, {3.4127085977136335`*^9, 
   3.4127086150185165`*^9}, {3.412710163144613*^9, 3.412710282996952*^9}, {
   3.412710603137291*^9, 3.412710606111568*^9}, {3.4127109416640687`*^9, 
   3.412710954142011*^9}, {3.412710984776061*^9, 3.4127109932181997`*^9}, {
   3.4222056448423743`*^9, 3.4222056980288525`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"thWrite", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", "0", "}"}], ",", 
     RowBox[{"{", ".4", "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", " ", "->", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Table", "[", 
   RowBox[{
    RowBox[{"RunTask", "[", 
     RowBox[{"thWrite", ",", 
      RowBox[{
       RowBox[{"Sin", "[", "x", "]"}], "//", "N"}]}], "]"}], ",", 
    RowBox[{"{", 
     RowBox[{"x", ",", "0", ",", 
      RowBox[{"4", "*", "Pi"}], ",", 
      RowBox[{"2", "*", 
       RowBox[{"Pi", "/", "100"}]}]}], "}"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite", "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.412708054542592*^9}, {3.412708549784715*^9, 
   3.4127085651968765`*^9}, {3.4127085977136335`*^9, 
   3.4127086150185165`*^9}, {3.412710163144613*^9, 3.412710282996952*^9}, {
   3.412710603137291*^9, 3.412710606111568*^9}, {3.4127109416640687`*^9, 
   3.412710954142011*^9}, {3.412710984776061*^9, 3.4127109932181997`*^9}, 
   3.4222056448423743`*^9, {3.51252139234375*^9, 3.5125213936875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"thWrite", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", "1.0", "}"}], ",", 
       RowBox[{"{", "2.0", "}"}]}], "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", " ", "->", "True"}], ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"Table", "[", 
   RowBox[{
    RowBox[{"RunTask", "[", 
     RowBox[{"thWrite", ",", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Sin", "[", "x", "]"}], ",", 
         RowBox[{"Cos", "[", "x", "]"}]}], "}"}], "//", "N"}]}], "]"}], ",", 
    RowBox[{"{", 
     RowBox[{"x", ",", "0", ",", 
      RowBox[{"4", "*", "Pi"}], ",", 
      RowBox[{"2", "*", 
       RowBox[{"Pi", "/", "100"}]}]}], "}"}]}], "]"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite", ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite", "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.412708054542592*^9}, {3.412708549784715*^9, 
   3.4127085651968765`*^9}, {3.4127085977136335`*^9, 
   3.4127086547256126`*^9}, {3.412708693791787*^9, 3.412708696565776*^9}, {
   3.4127087527866173`*^9, 3.4127087715836463`*^9}, 3.4127090119592896`*^9, {
   3.4127092792135825`*^9, 3.4127092850219345`*^9}, {3.412709621696048*^9, 
   3.4127096290065603`*^9}, {3.41270972255107*^9, 3.4127097351491857`*^9}, {
   3.41270996724292*^9, 3.4127099675733953`*^9}, {3.412710078593034*^9, 
   3.4127100848920913`*^9}, {3.412711038212899*^9, 3.4127110675150337`*^9}, 
   3.4127119060207453`*^9}],

Cell[BoxData[{
 RowBox[{"LogTest`TestName", "[", 
  "\"\<Outputting and Reading repeatedly on channels 0 and 1 using SetupOnly \
and RunTask for both\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"inputData", " ", "=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"Sin", "[", "x", "]"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"Cos", "[", "x", "]"}], "}"}]}], "}"}], "//", "N"}], ",", 
     RowBox[{"{", 
      RowBox[{"x", ",", "0", ",", 
       RowBox[{"8", "*", "Pi"}], ",", 
       RowBox[{"2", "*", 
        RowBox[{"Pi", "/", "100"}]}]}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thWrite", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", "0.0", "}"}], ",", 
       RowBox[{"{", "0.0", "}"}]}], "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", "\[Rule]", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thRead", " ", "=", " ", 
   RowBox[{"GetVoltages", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "3"}], "}"}], ",", "60", ",", "1", ",", 
     RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", " ", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"answer", " ", "=", 
   RowBox[{"Table", " ", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{"RunTask", "[", 
         RowBox[{"thWrite", ",", 
          RowBox[{"Flatten", "[", "p", "]"}]}], "]"}], ",", 
        RowBox[{"RunTask", "[", "thRead", "]"}]}], "}"}], "[", 
      RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
     RowBox[{"{", 
      RowBox[{"p", ",", "inputData"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"ListPlot", "[", 
  RowBox[{"Flatten", "[", 
   RowBox[{"answer", ",", "2"}], "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ListPlot", "[", 
   RowBox[{
    RowBox[{"Flatten", "[", 
     RowBox[{"inputData", ",", "2"}], "]"}], "-", 
    RowBox[{"Flatten", "[", 
     RowBox[{"answer", ",", "2"}], "]"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`pointsInError", " ", "=", " ", 
   RowBox[{"Count", "[", 
    RowBox[{
     RowBox[{"Abs", "[", 
      RowBox[{
       RowBox[{"Flatten", "[", 
        RowBox[{"inputData", ",", "2"}], "]"}], "-", " ", 
       RowBox[{"Flatten", "[", 
        RowBox[{"answer", ",", "2"}], "]"}]}], "]"}], ",", 
     RowBox[{"x_", " ", "/;", " ", 
      RowBox[{"x", "\[GreaterEqual]", " ", ".02"}]}]}], "]"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite", ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thRead", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{"LogTest`pointsInError", " ", "\[Equal]", "0"}], 
  "]"}], "\[IndentingNewLine]"}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.41270804122344*^9}, {3.4127081285690365`*^9, 
   3.4127081297607503`*^9}, {3.412708164050056*^9, 3.4127081946039906`*^9}, {
   3.4127082489621534`*^9, 3.4127082724759645`*^9}, {3.412708428320058*^9, 
   3.412708433157013*^9}, 3.412710089989421*^9, {3.4127120089888067`*^9, 
   3.412712092939522*^9}, {3.4127121683279247`*^9, 3.4127122037188144`*^9}, {
   3.4127122817610335`*^9, 3.4127122833433084`*^9}, {3.412712354044973*^9, 
   3.412712357299653*^9}, {3.4127124012127967`*^9, 3.412712469951638*^9}, {
   3.412712511711686*^9, 3.41271259477112*^9}, {3.4127127547711887`*^9, 
   3.4127127741891108`*^9}, {3.41271282275895*^9, 3.4127128538336334`*^9}, {
   3.4127128995393553`*^9, 3.412712904135965*^9}, {3.41271294869003*^9, 
   3.4127129487701454`*^9}, {3.412713206500744*^9, 3.412713214362048*^9}, 
   3.4127133533719344`*^9, {3.4151317222987785`*^9, 3.4151317712992373`*^9}, {
   3.415131812999199*^9, 3.415131892964183*^9}, {3.415132230098959*^9, 
   3.4151323352201157`*^9}, {3.4151323764994726`*^9, 3.4151324569251194`*^9}, 
   3.4151325153290997`*^9, {3.4151329178278646`*^9, 3.415132918148326*^9}, {
   3.422235925028411*^9, 3.422235926490514*^9}, {3.5125215188125*^9, 
   3.512521581015625*^9}, {3.5125216119375*^9, 3.51252161603125*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Checking Setup Only works independently for channels 0 and 1", \
"Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{
  3.415128358972553*^9, 3.41512841668554*^9, 3.4151316786660376`*^9, {
   3.4151317636382217`*^9, 3.4151317891248693`*^9}, {3.42220594676652*^9, 
   3.422205978341923*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Setup Only works independently for output channels\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thWrite0", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", "0", "}"}], ",", 
     RowBox[{"{", "0.0", "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"thWrite1", " ", "=", " ", 
    RowBox[{"OutputWaveform", "[", 
     RowBox[{
      RowBox[{"{", "1", "}"}], ",", 
      RowBox[{"{", "0.0", "}"}], ",", "10", ",", "10", ",", 
      RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", 
      RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], ";"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{"thWrite1", " ", "=", " ", 
    RowBox[{
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", "3", "}"}], ",", 
       RowBox[{"{", "0.0", "}"}], ",", "10", ",", "10", ",", 
       RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}], " ", "CRASHES", " ",
      "mathDAQ"}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"val0", " ", "=", "0.50"}], ";", " ", 
  RowBox[{"val1", "=", " ", 
   RowBox[{"-", "0.7"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite0", ",", "val0"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite1", ",", "val1"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"answer", " ", "=", 
  RowBox[{"Mean", "[", 
   RowBox[{"Transpose", "[", 
    RowBox[{"GetVoltages", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"0", ",", "3"}], "}"}], ",", "1000", ",", "100", ",", 
      RowBox[{"IncludeTime", "->", "Omit"}]}], "]"}], "]"}], 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite0", ",", "0"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite1", ",", "0"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite0", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thWrite1", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"(", 
      RowBox[{"Abs", "[", 
       RowBox[{"val0", "-", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"0", "+", "1"}], "]"}], "]"}]}], "]"}], ")"}], " ", 
     "\[LessEqual]", " ", "0.02"}], " ", "&&", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"Abs", "[", 
       RowBox[{"val1", " ", "-", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"1", "+", "1"}], "]"}], "]"}]}], "]"}], " ", "\[LessEqual]",
       " ", "0.02"}], ")"}]}], "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321079365997`*^9}, {3.412707500576027*^9, 
   3.4127075312801776`*^9}, {3.4127077389788337`*^9, 3.412707828317296*^9}, {
   3.4127078956240788`*^9, 3.41270804122344*^9}, {3.4127081285690365`*^9, 
   3.4127081297607503`*^9}, {3.412708164050056*^9, 3.4127081946039906`*^9}, {
   3.4127082489621534`*^9, 3.4127082724759645`*^9}, {3.412708428320058*^9, 
   3.412708433157013*^9}, 3.412710089989421*^9, {3.4127120089888067`*^9, 
   3.412712092939522*^9}, {3.4127121683279247`*^9, 3.4127122037188144`*^9}, {
   3.4127122817610335`*^9, 3.4127122833433084`*^9}, {3.412712354044973*^9, 
   3.412712357299653*^9}, {3.4127124012127967`*^9, 3.412712469951638*^9}, {
   3.412712511711686*^9, 3.41271259477112*^9}, {3.4127127547711887`*^9, 
   3.4127127741891108`*^9}, {3.41271282275895*^9, 3.4127128538336334`*^9}, {
   3.4127128995393553`*^9, 3.412712904135965*^9}, {3.41271294869003*^9, 
   3.4127129487701454`*^9}, {3.412713206500744*^9, 3.412713214362048*^9}, {
   3.4127133533719344`*^9, 3.4127134927523537`*^9}, {3.412713533671192*^9, 
   3.412713571475552*^9}, {3.4127155464854765`*^9, 3.412715588035222*^9}, {
   3.4128012636325474`*^9, 3.4128013018775406`*^9}, {3.422205986543717*^9, 
   3.4222060092964334`*^9}, {3.422206078726269*^9, 3.422206112625013*^9}, {
   3.4222061538242545`*^9, 3.4222062346104193`*^9}, {3.4222062799055505`*^9, 
   3.4222062859141903`*^9}, {3.42220632214629*^9, 3.4222063249903793`*^9}, {
   3.422206397965312*^9, 3.422206438343373*^9}, {3.422206480754357*^9, 
   3.422206520311237*^9}, {3.4222066491565075`*^9, 3.4222067128781347`*^9}, {
   3.4222067467268066`*^9, 3.422206780815824*^9}, {3.4222070384963503`*^9, 
   3.4222070511946096`*^9}, {3.512521706234375*^9, 3.512521762265625*^9}, {
   3.5125244979375*^9, 3.51252450940625*^9}, {3.5125248556875*^9, 
   3.512524863359375*^9}}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["Reading single samples using setup only - timing", "Subtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321777970543`*^9}, 3.412532593640395*^9, {
   3.412532663010144*^9, 3.412532687094776*^9}, {3.4127074763011217`*^9, 
   3.41270747991632*^9}, {3.4128014144293823`*^9, 3.412801430572595*^9}}],

Cell[TextData[{
 "The setup only method is preferred if Sample values read into to  ",
 StyleBox["Mathematica",
  FontSlant->"Italic"],
 " one at a time.  It avoids the setup cost. Note the ",
 StyleBox["Mathematica",
  FontSlant->"Italic"],
 " function Timing does not record the time accurate for calls to mathlinked \
code."
}], "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321443589725`*^9}, {3.4124321823736353`*^9, 
   3.4124322490194674`*^9}, {3.412532693754352*^9, 3.4125327303469696`*^9}, {
   3.415133217508785*^9, 3.415133231328657*^9}, {3.422207130108082*^9, 
   3.422207136647485*^9}, {3.512525766328125*^9, 3.512525843828125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Setup Only is faster than immediate mode for repeated read\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", " ", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "1.23", "}"}], ",", 
      RowBox[{"{", "2.34", "}"}]}], "}"}], ",", "1000.0", ",", "1", ",", 
    RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"thRead", " ", "=", " ", 
   RowBox[{"GetVoltages", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "3"}], "}"}], ",", "60", ",", "1", ",", 
     RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", " ", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"iterations1", "=", "800"}], ";", " ", 
  RowBox[{"iterations2", " ", "=", " ", "20"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ts", " ", "=", " ", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"\t", 
  RowBox[{
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"RunTask", "[", "thRead", "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", "0", ",", "iterations1"}], "}"}]}], "]"}], 
   ";"}]}], "\[IndentingNewLine]", 
 RowBox[{"tSetup", " ", "=", " ", 
  RowBox[{
   RowBox[{"AbsoluteTime", "[", "]"}], " ", "-", 
   "ts"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", "thRead", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thRead", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ts", " ", "=", " ", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\n", 
 RowBox[{"\t", 
  RowBox[{
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", "3"}], "}"}], ",", "60", ",", "1", ",", " ", 
       RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", "0", ",", "iterations2"}], "}"}]}], "]"}], 
   ";"}]}], "\[IndentingNewLine]", 
 RowBox[{"tImmediate", "  ", "=", " ", 
  RowBox[{
   RowBox[{"AbsoluteTime", "[", "]"}], " ", "-", 
   "ts"}]}], "\[IndentingNewLine]", 
 RowBox[{"GetVoltages", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"0", ",", "3"}], "}"}], ",", "60", ",", "1", ",", " ", 
   RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", " ", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "0.5", "}"}], ",", 
      RowBox[{"{", "0.5", "}"}]}], "}"}], ",", "1000.0", ",", "1"}], "]"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", "  ", 
   RowBox[{"TODO", ":", "  ", 
    RowBox[{
    "Understand", " ", "why", " ", "follow", " ", "cause", " ", "a", " ", 
     "problem", "\[IndentingNewLine]", "\t", 
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", " ", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"0.5", ",", "0.5"}], "}"}], ",", "1000.0", ",", "1"}], "]"}], 
     "\[IndentingNewLine]", "\t", "This", " ", "syntax", " ", "is", " ", 
     "accepted", " ", "and", " ", "change", " ", "voltage", " ", "but", " ", 
     "will", " ", "cause", " ", "python", " ", "test", " ", "runner", " ", 
     "to", " ", "hang"}]}], "\[IndentingNewLine]", " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"setupOnlyIPS", "=", " ", 
   RowBox[{
    RowBox[{"iterations1", "/", "tSetup"}], "//", "N"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ImmediateModeIPS", " ", "=", " ", 
   RowBox[{
    RowBox[{"iterations2", "/", "tImmediate"}], "//", "N"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{
   "\"\<Using setupOnly: \>\"", ",", "setupOnlyIPS", " ", ",", 
    "\"\< reads/second\>\""}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{
   "\"\<Using Immediate mode: \>\"", ",", " ", "ImmediateModeIPS", ",", " ", 
    "\"\< reads/second\>\""}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{"setupOnlyIPS", " ", ">", " ", "ImmediateModeIPS"}], "]"}], 
  ";"}], "\[IndentingNewLine]"}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4116602379345136`*^9, 3.411660277581523*^9}, {
   3.411660933895256*^9, 3.411660947685085*^9}, {3.4116610125884113`*^9, 
   3.411661060417186*^9}, {3.4116611071543903`*^9, 3.4116611073246355`*^9}, {
   3.4116611662994366`*^9, 3.4116611679918704`*^9}, {3.411661248277315*^9, 
   3.4116612484175167`*^9}, {3.41166129000732*^9, 3.4116613061104755`*^9}, {
   3.411661357404232*^9, 3.4116613767019806`*^9}, 3.411662468832387*^9, {
   3.411919196512947*^9, 3.4119191967833357`*^9}, {3.411919227807947*^9, 
   3.411919228579056*^9}, {3.411919904110422*^9, 3.411919905752784*^9}, {
   3.4119200637900305`*^9, 3.411920131747749*^9}, 3.4119201697924547`*^9, {
   3.4119206063401794`*^9, 3.4119206385565042`*^9}, {3.411922291563411*^9, 
   3.4119223056436577`*^9}, {3.4119225983445406`*^9, 3.411922604202965*^9}, 
   3.411922787596672*^9, {3.4119228298974977`*^9, 3.4119228999982977`*^9}, {
   3.411924604809696*^9, 3.411924626110325*^9}, {3.4119246603796015`*^9, 
   3.4119246664883857`*^9}, {3.4122859157203293`*^9, 3.412285978019912*^9}, {
   3.4123596833429613`*^9, 3.4123596836133504`*^9}, {3.412428602496024*^9, 
   3.4124286089853554`*^9}, {3.41242889606816*^9, 3.4124289136434317`*^9}, {
   3.412428991024701*^9, 3.412429000788741*^9}, {3.412429108423512*^9, 
   3.412429180376976*^9}, {3.412429230749408*^9, 3.4124292523905263`*^9}, {
   3.4124293042250605`*^9, 3.412429660867888*^9}, {3.4124297076251216`*^9, 
   3.412429750016077*^9}, {3.412429978474584*^9, 3.4124300574180994`*^9}, {
   3.4124302711253953`*^9, 3.4124302900526114`*^9}, {3.412430324341917*^9, 
   3.4124304634118896`*^9}, {3.412430565428582*^9, 3.4124306957960415`*^9}, {
   3.4124310392499037`*^9, 3.4124310749312115`*^9}, 3.4124312793551583`*^9, {
   3.4124317278300333`*^9, 3.4124317299230433`*^9}, {3.4124318391701326`*^9, 
   3.412431860300517*^9}, {3.412432030945893*^9, 3.4124320699720097`*^9}, {
   3.412432101226952*^9, 3.4124321443589725`*^9}, {3.412432254216941*^9, 
   3.412432263440203*^9}, {3.4124322971987457`*^9, 3.4124323848447742`*^9}, {
   3.4124324796010275`*^9, 3.4124325178460207`*^9}, {3.4124370597469535`*^9, 
   3.412437061449402*^9}, 3.4124370952179585`*^9, {3.4124371285458813`*^9, 
   3.412437159059758*^9}, {3.4124371891330013`*^9, 3.4124373404205427`*^9}, {
   3.4124373869574594`*^9, 3.4124373925154514`*^9}, {3.412437584761888*^9, 
   3.412437587746179*^9}, {3.412437825648266*^9, 3.412437864293835*^9}, {
   3.41243792796539*^9, 3.4124379396822386`*^9}, {3.4125327608007603`*^9, 
   3.4125327927066383`*^9}, {3.4125329948172593`*^9, 3.4125330146658*^9}, 
   3.4125331532550817`*^9, 3.4127128144970703`*^9, {3.4128013749726467`*^9, 
   3.412801397394888*^9}, {3.4128014488989472`*^9, 3.412801497819291*^9}, {
   3.412801536765293*^9, 3.4128016995193214`*^9}, {3.412801739336576*^9, 
   3.412801861872774*^9}, {3.4151330847578983`*^9, 3.415133088102708*^9}, {
   3.422207093885997*^9, 3.4222071127931843`*^9}, {3.4222071526905537`*^9, 
   3.422207365566654*^9}, {3.422207487331744*^9, 3.422207526998782*^9}, 
   3.422237828635664*^9, 3.4222378640966544`*^9, {3.4222379006392*^9, 
   3.4222379149297485`*^9}, {3.422238055231493*^9, 3.4222380666378946`*^9}, {
   3.422238115167677*^9, 3.4222381472438*^9}, {3.4222381814329615`*^9, 
   3.422238188102552*^9}, {3.422238225486307*^9, 3.4222382258267965`*^9}, 
   3.422238276970338*^9, {3.42223832725264*^9, 3.422238338969488*^9}, 
   3.4222383852460303`*^9, {3.4222392946336656`*^9, 3.422239298539282*^9}, {
   3.422239345506818*^9, 3.422239347639885*^9}, {3.447702038109375*^9, 
   3.447702043515625*^9}, {3.51252182378125*^9, 3.512521850765625*^9}, {
   3.512522028203125*^9, 3.51252203084375*^9}, 3.512522089546875*^9, {
   3.51252226240625*^9, 3.51252226475*^9}, 3.512522493734375*^9, {
   3.51252254075*^9, 3.51252254871875*^9}, {3.512522583953125*^9, 
   3.5125226344375*^9}, {3.51252266909375*^9, 3.512522679296875*^9}, 
   3.512523097984375*^9, {3.512523524078125*^9, 3.512523534703125*^9}, {
   3.512523613625*^9, 3.512523618546875*^9}, 3.51252368884375*^9, {
   3.512523735140625*^9, 3.512523771078125*^9}, {3.51252381796875*^9, 
   3.512523846671875*^9}, 3.5125239955625*^9, {3.512524075375*^9, 
   3.5125240796875*^9}, {3.51252413078125*^9, 3.512524131359375*^9}, {
   3.512524163828125*^9, 3.512524290625*^9}, {3.512524392765625*^9, 
   3.51252442121875*^9}, {3.5125253665625*^9, 3.51252539871875*^9}, {
   3.512525520015625*^9, 3.512525575640625*^9}, {3.512525623203125*^9, 
   3.512525656328125*^9}, {3.5125256933125*^9, 3.51252575953125*^9}, {
   3.512525881328125*^9, 3.512525963234375*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Outputing waveform", "Subtitle",
 CellChangeTimes->{{3.4119201802975597`*^9, 3.4119201929757905`*^9}, {
  3.411920247243824*^9, 3.4119202474340973`*^9}, {3.411920376649901*^9, 
  3.4119203774210095`*^9}, {3.4119204167075005`*^9, 3.41192045134731*^9}, {
  3.4119229734739504`*^9, 3.4119230023654947`*^9}}],

Cell[TextData[{
 "With contiunous waveforms you must save the task so that you can stop the \
task later! The pasue statement is necessary whern running commands semms to \
be related to the ",
 StyleBox["output frequency when output a single sample!  Fix this!!",
  FontFamily->"Times New Roman",
  FontSize->16,
  FontWeight->"Bold"],
 StyleBox[".",
  FontSize->16,
  FontWeight->"Bold"]
}], "Text",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.4128021101497793`*^9}, {
  3.422239045104861*^9, 3.422239092452944*^9}, {3.4222395393555584`*^9, 
  3.4222395803645267`*^9}, {3.42223962536924*^9, 3.4222396273520913`*^9}}],

Cell[CellGroupData[{

Cell["Output single channel waveform", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801996826829*^9}, {
   3.412802127765109*^9, 3.41280215744779*^9}, {3.4128023160358286`*^9, 
   3.4128023168469954`*^9}, {3.412802988402645*^9, 3.41280301035421*^9}, {
   3.412803041498994*^9, 3.4128031074838753`*^9}, {3.412803149614456*^9, 
   3.412803184094035*^9}, 3.412803230310491*^9, 3.412803273102022*^9, {
   3.415133266979921*^9, 3.415133317091978*^9}, {3.4151333641396294`*^9, 
   3.415133388254305*^9}, 3.415133420831148*^9, {3.4151335042711287`*^9, 
   3.41513380101783*^9}, {3.415133843779318*^9, 3.4151338844578104`*^9}, {
   3.415133926578377*^9, 3.4151339288216023`*^9}, {3.415134009808055*^9, 
   3.4151340409628534`*^9}, {3.4165837467578096`*^9, 3.4165837602972784`*^9}, 
   3.4222076344332657`*^9, {3.4222077285886545`*^9, 3.4222077403055024`*^9}, 
   3.422236684320219*^9, 3.4222367186595964`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{"Pause", "[", ".1", "]"}], " ", "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
    "LogTest`TestName", "[", 
     "\"\<Outputing waveform single channel using interrupts\>\"", "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"numPts", " ", "=", "200"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"offset", " ", "=", " ", "0.9"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"data", " ", "=", " ", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Sin", "[", 
         RowBox[{"x", "+", "offset"}], "]"}], "//", "N"}], ",", 
       RowBox[{"{", 
        RowBox[{"x", ",", "0", ",", 
         RowBox[{
          RowBox[{"2", "*", " ", "Pi"}], "-", 
          RowBox[{"2", "*", 
           RowBox[{"Pi", "/", "numPts"}]}]}], ",", 
         RowBox[{"2", "*", 
          RowBox[{"Pi", "/", "numPts"}]}]}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"freqWritePts", "=", "1500.0"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"freqWave", " ", "=", " ", 
     RowBox[{"freqWritePts", "/", "numPts"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"freqReadPts", " ", "=", "2000.0"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ii", "=", "0"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"dataForPlot", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{
          RowBox[{"ii", "++"}], "/", "freqWritePts"}], ",", "p"}], "}"}], ",",
        " ", 
       RowBox[{"{", 
        RowBox[{"p", ",", "data"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"th", " ", "=", " ", 
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", "data", ",", " ", "freqWritePts", ",", 
       "1", ",", 
       RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "Interrupts"}], ",", 
       RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"answer", " ", "=", " ", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", "freqReadPts", ",", "250", ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}]}], "]"}]}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{"ListPlot", "[", 
    RowBox[{"answer", ",", 
     RowBox[{"Joined", "\[Rule]", "False"}]}], "]"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"ff", "[", 
     RowBox[{"x_", ",", "B_", ",", "p2_"}], "]"}], ":=", " ", 
    RowBox[{"If", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"answer", "[", 
        RowBox[{"[", 
         RowBox[{"1", ",", "2"}], "]"}], "]"}], " ", "<", " ", 
       RowBox[{"answer", "[", 
        RowBox[{"[", 
         RowBox[{"p2", ",", "2"}], "]"}], "]"}]}], ",", " ", 
      RowBox[{"Sin", "[", 
       RowBox[{
        RowBox[{"2", "*", "Pi", "*", "freqWave", "*", "x"}], " ", "+", "B"}], 
       "]"}], ",", "\[IndentingNewLine]", 
      RowBox[{"-", 
       RowBox[{"Sin", "[", 
        RowBox[{
         RowBox[{"2", "*", "Pi", "*", "freqWave", "*", "x"}], " ", "-", "B"}],
         "]"}]}]}], "]"}]}], "\[IndentingNewLine]", 
   RowBox[{"pt2", " ", "=", " ", 
    RowBox[{"If", "[", 
     RowBox[{
      RowBox[{"freqReadPts", " ", "<", " ", "freqWritePts"}], ",", "1", ",", 
      RowBox[{"Round", "[", 
       RowBox[{
        RowBox[{"freqReadPts", "/", "freqWritePts"}], "+", "2"}], "]"}]}], 
     "]"}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"B", " ", "=", " ", 
     RowBox[{"ArcSin", "[", 
      RowBox[{"answer", "[", 
       RowBox[{"[", 
        RowBox[{"1", ",", "2"}], "]"}], "]"}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Plot", "[", 
     RowBox[{
      RowBox[{"ff", "[", 
       RowBox[{"x", ",", "B", ",", "pt2"}], "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"x", ",", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{"1", ",", "1"}], "]"}], "]"}], ",", 
        RowBox[{"answer", "[", 
         RowBox[{"[", 
          RowBox[{
           RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}]}], "}"}]}], "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ListPlot", "[", "answer", "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Show", "[", 
    RowBox[{"%", ",", "%%"}], "]"}], "\[IndentingNewLine]", 
   RowBox[{"aveErr", "  ", "=", 
    RowBox[{
     RowBox[{"Total", "[", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Abs", "[", 
         RowBox[{
          RowBox[{"ff", "[", 
           RowBox[{
            RowBox[{"x", "[", 
             RowBox[{"[", "1", "]"}], "]"}], ",", "B", ",", "pt2"}], "]"}], 
          " ", "-", " ", 
          RowBox[{"x", "[", 
           RowBox[{"[", "2", "]"}], "]"}]}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"x", ",", "answer"}], "}"}]}], "]"}], "]"}], "/", 
     RowBox[{"Length", "[", "answer", "]"}]}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"LogTest`Assert", "[", 
     RowBox[{"aveErr", " ", "<", " ", ".05"}], "]"}], ";"}]}]}]], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801996826829*^9}, {
   3.412802127765109*^9, 3.41280215744779*^9}, {3.4128023160358286`*^9, 
   3.4128023168469954`*^9}, {3.412802988402645*^9, 3.41280301035421*^9}, {
   3.412803041498994*^9, 3.4128031074838753`*^9}, {3.412803149614456*^9, 
   3.412803184094035*^9}, 3.412803230310491*^9, 3.412803273102022*^9, {
   3.415133266979921*^9, 3.415133317091978*^9}, {3.4151333641396294`*^9, 
   3.415133388254305*^9}, 3.415133420831148*^9, {3.4151335042711287`*^9, 
   3.41513380101783*^9}, {3.415133843779318*^9, 3.4151338844578104`*^9}, {
   3.415133926578377*^9, 3.4151339288216023`*^9}, {3.415134009808055*^9, 
   3.4151340409628534`*^9}, {3.4165837467578096`*^9, 3.4165837602972784`*^9}, 
   3.4222076344332657`*^9, {3.4222077285886545`*^9, 3.4222077403055024`*^9}, 
   3.422236684320219*^9, 3.4222367186595964`*^9, 3.422236757715757*^9, 
   3.422237080509912*^9, {3.4222371604248238`*^9, 3.4222371605650253`*^9}, 
   3.422237575471632*^9, {3.422238649235629*^9, 3.422238654573304*^9}, {
   3.4222387956161137`*^9, 3.4222387965975246`*^9}, {3.4222388659772882`*^9, 
   3.422238876392264*^9}, 3.422238924441355*^9, {3.422238998758218*^9, 
   3.422238999078678*^9}, {3.4222392764475155`*^9, 3.4222392774088974`*^9}, {
   3.422239636084648*^9, 3.4222396365453105`*^9}, {3.447269725453125*^9, 
   3.447269729203125*^9}, {3.5125250245*^9, 3.512525056390625*^9}, {
   3.51252509803125*^9, 3.512525100484375*^9}, {3.512587614203125*^9, 
   3.5125876156875*^9}, {3.5125880005*^9, 3.512588003421875*^9}, {
   3.512588420625*^9, 3.512588427296875*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Single Channel Waveform output using DMA (Direct Memory Addressing)\
\>", "Subsubtitle",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801996826829*^9}, {
   3.412802127765109*^9, 3.41280215744779*^9}, {3.4128023160358286`*^9, 
   3.4128023168469954`*^9}, {3.412802988402645*^9, 3.41280301035421*^9}, {
   3.412803041498994*^9, 3.4128031074838753`*^9}, {3.412803149614456*^9, 
   3.412803184094035*^9}, 3.412803230310491*^9, 3.412803273102022*^9, {
   3.415133266979921*^9, 3.415133317091978*^9}, {3.4151333641396294`*^9, 
   3.415133388254305*^9}, 3.415133420831148*^9, {3.4151335042711287`*^9, 
   3.41513380101783*^9}, {3.415133843779318*^9, 3.4151338844578104`*^9}, {
   3.415133926578377*^9, 3.4151339288216023`*^9}, {3.415134009808055*^9, 
   3.4151340409628534`*^9}, {3.4165837467578096`*^9, 3.4165837602972784`*^9}, 
   3.416583798311941*^9, 3.416583847162184*^9, {3.416583936991352*^9, 
   3.4165839921106095`*^9}, {3.4172738395316753`*^9, 3.417273840282755*^9}, {
   3.417274383453797*^9, 3.4172743857871523`*^9}, {3.5125262445*^9, 
   3.512526259375*^9}, {3.51252646990625*^9, 3.51252653703125*^9}, 
   3.512526591796875*^9, {3.51252666740625*^9, 3.512526667484375*^9}, {
   3.512526710125*^9, 3.5125267123125*^9}, {3.512527594328125*^9, 
   3.512527645328125*^9}, {3.512527735390625*^9, 3.512527740359375*^9}, 
   3.51252778325*^9, {3.512531864203125*^9, 3.51253186440625*^9}, {
   3.512532023375*^9, 3.5125320405625*^9}, {3.5125320973125*^9, 
   3.512532137625*^9}, {3.51253220640625*^9, 3.512532232953125*^9}, {
   3.5125323240625*^9, 3.512532332171875*^9}, 3.512587595671875*^9, {
   3.512588154640625*^9, 3.5125881608125*^9}, {3.512588201671875*^9, 
   3.512588247984375*^9}, {3.512588317828125*^9, 3.512588435515625*^9}, {
   3.5125884968125*^9, 3.51258866396875*^9}}],

Cell["\<\
In the following test all combinations of transfer mechanism for  GetVoltages \
and OutputWaveform seem to work.  I remember having to switch transfer \
mechanism for some reason.  Perhaps speed or more channels. Investigate speed \
of acquistion using interrupts.\
\>", "Text",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801996826829*^9}, {
   3.412802127765109*^9, 3.41280215744779*^9}, {3.4128023160358286`*^9, 
   3.4128023168469954`*^9}, {3.412802988402645*^9, 3.41280301035421*^9}, {
   3.412803041498994*^9, 3.4128031074838753`*^9}, {3.412803149614456*^9, 
   3.412803184094035*^9}, 3.412803230310491*^9, 3.412803273102022*^9, {
   3.415133266979921*^9, 3.415133317091978*^9}, {3.4151333641396294`*^9, 
   3.415133388254305*^9}, 3.415133420831148*^9, {3.4151335042711287`*^9, 
   3.41513380101783*^9}, {3.415133843779318*^9, 3.4151338844578104`*^9}, {
   3.415133926578377*^9, 3.4151339288216023`*^9}, {3.415134009808055*^9, 
   3.4151340409628534`*^9}, {3.4165837467578096`*^9, 3.4165837602972784`*^9}, 
   3.416583798311941*^9, 3.416583847162184*^9, {3.416583936991352*^9, 
   3.4165839921106095`*^9}, {3.4172738395316753`*^9, 3.417273840282755*^9}, {
   3.417274383453797*^9, 3.4172743857871523`*^9}, {3.5125262445*^9, 
   3.512526259375*^9}, {3.51252646990625*^9, 3.51252653703125*^9}, 
   3.512526591796875*^9, {3.51252666740625*^9, 3.512526667484375*^9}, {
   3.512526710125*^9, 3.5125267123125*^9}, {3.512527594328125*^9, 
   3.512527645328125*^9}, {3.512527735390625*^9, 3.512527740359375*^9}, 
   3.51252778325*^9, {3.512531864203125*^9, 3.51253186440625*^9}, {
   3.512532023375*^9, 3.5125320405625*^9}, {3.5125320973125*^9, 
   3.512532137625*^9}, {3.51253220640625*^9, 3.512532232953125*^9}, {
   3.5125323240625*^9, 3.512532332171875*^9}, 3.512587595671875*^9, {
   3.512588154640625*^9, 3.5125881608125*^9}, {3.512588201671875*^9, 
   3.512588247984375*^9}, {3.512588317828125*^9, 3.512588435515625*^9}, {
   3.5125884968125*^9, 3.512588676859375*^9}, {3.512588708328125*^9, 
   3.51258873928125*^9}, {3.51258881346875*^9, 3.512588836859375*^9}, 
   3.512588914828125*^9, {3.51258895784375*^9, 3.512589092140625*^9}, {
   3.51259455728125*^9, 3.5125945760625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{
   "constants", " ", "hardcoded", " ", "at", " ", "the", " ", "moment"}], " ",
    "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
    "LogTest`TestName", "[", 
     "\"\<Outputing waveform single channel using DMA\>\"", "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"data", " ", "=", " ", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"3", "*", 
         RowBox[{"Sin", "[", "x", "]"}]}], "//", "N"}], ",", 
       RowBox[{"{", 
        RowBox[{"x", ",", "0", ",", 
         RowBox[{
          RowBox[{"2", "*", " ", "Pi"}], "-", 
          RowBox[{"2", "*", 
           RowBox[{"Pi", "/", "100"}]}]}], ",", 
         RowBox[{"2", "*", 
          RowBox[{"Pi", "/", "100"}]}]}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"freqOut", "=", "1000.0"}], ";", " ", 
    RowBox[{"freqIn", " ", "=", "1000.0"}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ii", "=", "0"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"dataForPlot", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{
          RowBox[{"ii", "++"}], "/", "freqOut"}], ",", "p"}], "}"}], ",", " ", 
       RowBox[{"{", 
        RowBox[{"p", ",", "data"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"th", " ", "=", " ", 
    RowBox[{"OutputWaveform", "[", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", "data", ",", " ", "freqOut", ",", "3", 
      ",", 
      RowBox[{"SampleMode", " ", "\[Rule]", "Continuous"}], ",", 
      RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
      RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"answer", " ", "=", " ", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", "freqIn", ",", "200", ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", "Interrupts"}]}], "]"}]}],
     ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ListPlot", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"dataForPlot", ",", "answer"}], "}"}], ",", 
      RowBox[{"Joined", "\[Rule]", "False"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Clear", "[", "f", "]"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"lp", " ", "=", " ", 
     RowBox[{"ListPlot", "[", "answer", "]"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"f1", " ", "=", " ", 
    RowBox[{"Fit", "[", 
     RowBox[{"answer", ",", " ", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"Sin", "[", 
         RowBox[{"2", "*", "Pi", "*", "10", "*", "x"}], "]"}], ",", " ", 
        RowBox[{"Cos", "[", 
         RowBox[{"2", "*", "Pi", " ", "*", "10", "*", "x"}], "]"}]}], "}"}], 
      ",", "x"}], "]"}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"fp1", " ", "=", " ", 
     RowBox[{"Plot", "[", 
      RowBox[{"f1", ",", 
       RowBox[{"{", 
        RowBox[{"x", ",", "0", ",", ".2"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"Show", "[", 
    RowBox[{"lp", ",", "fp1"}], "]"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"f", "[", "xx_", "]"}], ":=", 
    RowBox[{"f1", "/.", " ", 
     RowBox[{"x", "\[Rule]", " ", "xx"}]}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"errs", " ", "=", " ", 
     RowBox[{"Abs", "[", 
      RowBox[{
       RowBox[{"answer", "[", 
        RowBox[{"[", 
         RowBox[{"All", ",", "2"}], "]"}], "]"}], "-", 
       RowBox[{"Table", "[", " ", 
        RowBox[{
         RowBox[{"f", "[", "pt", "]"}], ",", " ", 
         RowBox[{"{", 
          RowBox[{"pt", ",", 
           RowBox[{"answer", "[", 
            RowBox[{"[", 
             RowBox[{"All", ",", "1"}], "]"}], "]"}]}], "}"}]}], "]"}]}], 
      "]"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"fractionalErr", " ", "=", " ", 
     RowBox[{
      RowBox[{"Total", "[", "errs", "]"}], "/", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"Length", "[", "errs", "]"}], "*", 
        RowBox[{"Max", "[", "answer", "]"}]}], ")"}]}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"LogTest`Assert", "[", 
     RowBox[{"fractionalErr", " ", "\[LessEqual]", " ", "0.02"}], "]"}], 
    ";"}]}]}]], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801996826829*^9}, {
   3.412802127765109*^9, 3.41280215744779*^9}, {3.4128023160358286`*^9, 
   3.4128023168469954`*^9}, {3.412802988402645*^9, 3.41280301035421*^9}, {
   3.412803041498994*^9, 3.4128031074838753`*^9}, {3.412803149614456*^9, 
   3.412803184094035*^9}, 3.412803230310491*^9, 3.412803273102022*^9, {
   3.415133266979921*^9, 3.415133317091978*^9}, {3.4151333641396294`*^9, 
   3.415133388254305*^9}, 3.415133420831148*^9, {3.4151335042711287`*^9, 
   3.41513380101783*^9}, {3.415133843779318*^9, 3.4151338844578104`*^9}, {
   3.415133926578377*^9, 3.4151339288216023`*^9}, {3.415134009808055*^9, 
   3.4151340409628534`*^9}, {3.4165837467578096`*^9, 3.4165837602972784`*^9}, 
   3.416583798311941*^9, 3.416583847162184*^9, {3.416583936991352*^9, 
   3.4165839921106095`*^9}, {3.4172738395316753`*^9, 3.417273840282755*^9}, {
   3.417274383453797*^9, 3.4172743857871523`*^9}, {3.5125262445*^9, 
   3.512526259375*^9}, {3.51252646990625*^9, 3.51252653703125*^9}, 
   3.512526591796875*^9, {3.51252666740625*^9, 3.512526667484375*^9}, {
   3.512526710125*^9, 3.5125267123125*^9}, {3.512527594328125*^9, 
   3.512527645328125*^9}, {3.512527735390625*^9, 3.512527740359375*^9}, 
   3.51252778325*^9, {3.512531864203125*^9, 3.51253186440625*^9}, {
   3.512532023375*^9, 3.5125320405625*^9}, {3.5125320973125*^9, 
   3.512532137625*^9}, {3.51253220640625*^9, 3.512532232953125*^9}, {
   3.5125323240625*^9, 3.512532332171875*^9}, 3.512587595671875*^9, {
   3.512588154640625*^9, 3.5125881608125*^9}, {3.512588201671875*^9, 
   3.512588247984375*^9}, {3.512588317828125*^9, 3.512588435515625*^9}, {
   3.5125884968125*^9, 3.512588676859375*^9}, {3.512588761328125*^9, 
   3.512588763390625*^9}, {3.512588840015625*^9, 3.512588877703125*^9}, 
   3.51258924553125*^9, {3.5125944325625*^9, 3.51259445246875*^9}, {
   3.512594499609375*^9, 3.512594549890625*^9}, {3.512594588421875*^9, 
   3.512594600640625*^9}}],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801996826829*^9}, {
   3.412802127765109*^9, 3.41280215744779*^9}, {3.4128023160358286`*^9, 
   3.4128023168469954`*^9}, {3.412802988402645*^9, 3.41280301035421*^9}, {
   3.412803041498994*^9, 3.4128031074838753`*^9}, {3.412803149614456*^9, 
   3.412803184094035*^9}, 3.412803230310491*^9, 3.412803273102022*^9, {
   3.415133266979921*^9, 3.415133317091978*^9}, {3.4151333641396294`*^9, 
   3.415133388254305*^9}, 3.415133420831148*^9, {3.4151335042711287`*^9, 
   3.41513380101783*^9}, {3.415133843779318*^9, 3.4151338844578104`*^9}, {
   3.415133926578377*^9, 3.4151339288216023`*^9}, {3.415134009808055*^9, 
   3.4151340409628534`*^9}, {3.4165837467578096`*^9, 3.4165837602972784`*^9}, 
   3.416583798311941*^9, 3.416583847162184*^9, 3.51252624940625*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Two Channel Waveform output using DMA (Direct Memory Addressing)\
\>", "Subsubtitle",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801950269883*^9}, {
   3.4128022228217936`*^9, 3.412802226416963*^9}, {3.4128022960270576`*^9, 
   3.412802365116403*^9}, {3.41280239629123*^9, 3.4128023965616193`*^9}, {
   3.412802436258701*^9, 3.4128024870717664`*^9}, 3.412802702040877*^9, {
   3.4128033073612847`*^9, 3.412803335331504*^9}, {3.4128033876667585`*^9, 
   3.4128033942962914`*^9}, {3.4128035128467584`*^9, 3.412803560705576*^9}, 
   3.4128036196703634`*^9, {3.512589117*^9, 3.51258913621875*^9}, {
   3.5125896946875*^9, 3.512589695734375*^9}}],

Cell["Again all combinatios of DMA and interrupts seem to work", "Text",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801950269883*^9}, {
   3.4128022228217936`*^9, 3.412802226416963*^9}, {3.4128022960270576`*^9, 
   3.412802365116403*^9}, {3.41280239629123*^9, 3.4128023965616193`*^9}, {
   3.412802436258701*^9, 3.4128024870717664`*^9}, 3.412802702040877*^9, {
   3.4128033073612847`*^9, 3.412803335331504*^9}, {3.4128033876667585`*^9, 
   3.4128033942962914`*^9}, {3.4128035128467584`*^9, 3.412803560705576*^9}, 
   3.4128036196703634`*^9, {3.512589117*^9, 3.51258913621875*^9}, {
   3.51258971340625*^9, 3.5125897283125*^9}, {3.512593186453125*^9, 
   3.512593193859375*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", "\"\<Outputing waveform two channel\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", 
   RowBox[{
   "data", ",", "th", ",", "ans", ",", "f0", ",", "f1", ",", "ch0", ",", 
    "ch1", ",", "fe"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"data", " ", "=", " ", 
   RowBox[{"Transpose", "[", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Sin", "[", "x", "]"}], ",", 
         RowBox[{"Cos", "[", "x", "]"}]}], "}"}], "//", "N"}], ",", 
      RowBox[{"{", 
       RowBox[{"x", ",", "0", ",", 
        RowBox[{
         RowBox[{"2", "*", " ", "Pi"}], "-", 
         RowBox[{"2", "*", 
          RowBox[{"Pi", "/", "100"}]}]}], ",", 
        RowBox[{"2", "*", 
         RowBox[{"Pi", "/", "100"}]}]}], "}"}]}], "]"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"th", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", "data", ",", " ", "10000.0", ",", 
     "1", ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
     RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "Interrupts"}], ",", 
     RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"ListPlot", "[", 
   RowBox[{
    RowBox[{"ans", " ", "=", " ", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", "3"}], "}"}], ",", "10000.0", ",", "200", ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}]}], "]"}]}], ",", 
    RowBox[{"Joined", "\[Rule]", "True"}], ",", 
    RowBox[{"Mesh", "\[Rule]", "All"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"ClearTask", "[", "th", "]"}], ";"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{"ch0", ",", " ", "ch1"}], "}"}], " ", "=", "ans"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"f0", "[", "xx_", "]"}], "=", 
   RowBox[{
    RowBox[{"Fit", "[", 
     RowBox[{"ch0", ",", " ", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"Sin", "[", 
         RowBox[{"2", "*", "Pi", "*", "100", "*", "x"}], "]"}], ",", " ", 
        RowBox[{"Cos", "[", 
         RowBox[{"2", "*", "Pi", " ", "*", "100", "*", "x"}], "]"}]}], "}"}], 
      ",", "x"}], "]"}], "/.", 
    RowBox[{"x", "\[Rule]", "xx"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"f1", "[", "xx_", "]"}], "=", 
   RowBox[{
    RowBox[{"Fit", "[", 
     RowBox[{"ch1", ",", " ", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"Sin", "[", 
         RowBox[{"2", "*", "Pi", "*", "100", "*", "x"}], "]"}], ",", " ", 
        RowBox[{"Cos", "[", 
         RowBox[{"2", "*", "Pi", " ", "*", "100", "*", "x"}], "]"}]}], "}"}], 
      ",", "x"}], "]"}], "/.", 
    RowBox[{"x", "\[Rule]", "xx"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p1", " ", "=", 
   RowBox[{"ListPlot", "[", 
    RowBox[{"{", 
     RowBox[{"ch0", ",", "ch1"}], "}"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p2", " ", "=", " ", 
   RowBox[{"Plot", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"f0", "[", "t", "]"}], ",", 
       RowBox[{"f1", "[", "t", "]"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"t", ",", "0", ",", ".01"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"Show", "[", 
  RowBox[{"p1", ",", "p2"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"errs", " ", "=", " ", 
   RowBox[{"Abs", "[", 
    RowBox[{
     RowBox[{"ans", "[", 
      RowBox[{"[", 
       RowBox[{"All", ",", "All", ",", "2"}], "]"}], "]"}], "-", 
     RowBox[{"Transpose", "[", 
      RowBox[{"Table", "[", " ", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{
          RowBox[{"f0", "[", "pt", "]"}], ",", " ", 
          RowBox[{"f1", "[", "pt", "]"}]}], "}"}], ",", " ", 
        RowBox[{"{", 
         RowBox[{"pt", ",", 
          RowBox[{"ans", "[", 
           RowBox[{"[", 
            RowBox[{"1", ",", "All", ",", "1"}], "]"}], "]"}]}], "}"}]}], 
       "]"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"fe", " ", "=", " ", 
  RowBox[{
   RowBox[{"Total", "[", 
    RowBox[{"errs", ",", "2"}], "]"}], "/", 
   RowBox[{"Length", "[", 
    RowBox[{"Flatten", "[", "errs", "]"}], "]"}]}]}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{"fe", " ", "\[LessEqual]", " ", "0.02"}], 
  "]"}], "\[IndentingNewLine]"}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801950269883*^9}, {
   3.4128022228217936`*^9, 3.412802226416963*^9}, {3.4128022960270576`*^9, 
   3.412802365116403*^9}, {3.41280239629123*^9, 3.4128023965616193`*^9}, {
   3.412802436258701*^9, 3.4128024870717664`*^9}, 3.412802702040877*^9, {
   3.4128033073612847`*^9, 3.412803335331504*^9}, {3.4128033876667585`*^9, 
   3.4128033942962914`*^9}, {3.4128035128467584`*^9, 3.412803560705576*^9}, 
   3.4128036196703634`*^9, {3.512589117*^9, 3.51258913125*^9}, {
   3.512589186921875*^9, 3.512589210296875*^9}, {3.5125900820625*^9, 
   3.512590084921875*^9}, 3.5125901224375*^9, {3.512590300453125*^9, 
   3.512590323421875*^9}, 3.512592046359375*^9, {3.512592082046875*^9, 
   3.5125921248125*^9}, {3.51259319721875*^9, 3.512593226890625*^9}, {
   3.51259337509375*^9, 3.51259338528125*^9}, {3.51259359359375*^9, 
   3.5125937005*^9}, {3.512678893796875*^9, 3.512678991640625*^9}, {
   3.512679028703125*^9, 3.512679043875*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{
   "hmm", " ", "not", " ", "sure", " ", "if", " ", "it", " ", "is", " ", 
    "possible", " ", "to", " ", "have", " ", "two", " ", "independent", " ", 
    "output", " ", "channels", " ", "in", " ", "separate", " ", "continuous", 
    " ", "mode", " ", "should", " ", "be", " ", "possible", " ", 
    "\[IndentingNewLine]", "The", " ", "following", " ", "does", " ", "not", 
    " ", "work"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"data", " ", "=", " ", 
     RowBox[{"Transpose", "[", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"{", 
          RowBox[{
           RowBox[{"Sin", "[", "x", "]"}], ",", 
           RowBox[{"Cos", "[", "x", "]"}]}], "}"}], "//", "N"}], ",", 
        RowBox[{"{", 
         RowBox[{"x", ",", "0", ",", 
          RowBox[{"2", "*", " ", "Pi"}], ",", ".1"}], "}"}]}], "]"}], "]"}]}],
     ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"th1", " ", "=", " ", 
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", 
       RowBox[{"data", "[", 
        RowBox[{"[", "1", "]"}], "]"}], ",", " ", "1000.0", ",", "1", ",", 
       RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
       RowBox[{"MessageLevel", " ", "\[Rule]", "1"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"th2", " ", "=", " ", 
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", "1", "}"}], ",", 
       RowBox[{"data", "[", 
        RowBox[{"[", "2", "]"}], "]"}], ",", " ", "1000.0", ",", "1", ",", 
       RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "Interrupts"}], ",", 
       RowBox[{"MessageLevel", " ", "\[Rule]", "1"}]}], "]"}]}], 
    ";"}]}]}]], "Input",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801950269883*^9}, {
   3.4128022228217936`*^9, 3.412802226416963*^9}, {3.4128022960270576`*^9, 
   3.412802365116403*^9}, {3.41280239629123*^9, 3.4128023965616193`*^9}, 
   3.412802436258701*^9, {3.412802518126421*^9, 3.412802541920635*^9}, {
   3.412802730261456*^9, 3.4128028273610783`*^9}, {3.4128028837221217`*^9, 
   3.4128028838623233`*^9}, {3.412805517339077*^9, 3.412805522957155*^9}, {
   3.4128066766260495`*^9, 3.4128066919180384`*^9}, {3.4128067481689234`*^9, 
   3.4128067534364977`*^9}, {3.412806795607136*^9, 3.412806828153936*^9}, {
   3.412806946474072*^9, 3.4128069488675137`*^9}, {3.4128070686297235`*^9, 
   3.412807114645891*^9}, {3.412807409239496*^9, 3.4128074681341825`*^9}, {
   3.512593937640625*^9, 3.512593952265625*^9}}],

Cell[BoxData[{
 RowBox[{"ClearTask", "[", "th2", "]"}], "\[IndentingNewLine]", 
 RowBox[{"ClearTask", "[", "th1", "]"}]}], "Input",
 CellChangeTimes->{{3.4128019157602606`*^9, 3.412801950269883*^9}, {
   3.4128022228217936`*^9, 3.412802226416963*^9}, {3.4128022960270576`*^9, 
   3.412802365116403*^9}, {3.41280239629123*^9, 3.4128023965616193`*^9}, 
   3.412802436258701*^9, {3.412802518126421*^9, 3.412802541920635*^9}, {
   3.412802730261456*^9, 3.4128028273610783`*^9}, {3.4128028837221217`*^9, 
   3.4128028838623233`*^9}, {3.412805517339077*^9, 3.412805522957155*^9}, {
   3.4128066766260495`*^9, 3.4128066919180384`*^9}, {3.4128067481689234`*^9, 
   3.4128067534364977`*^9}, 3.412806795607136*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["Reading Voltages tests extra", "Subtitle",
 CellChangeTimes->{{3.411923030345728*^9, 3.4119230576249533`*^9}, {
  3.44726829815625*^9, 3.44726830140625*^9}, {3.4472708905*^9, 
  3.447270895203125*^9}, {3.44727092846875*^9, 3.447270962453125*^9}}],

Cell["\<\
Extra GetVoltageTests that were not covered in ouputing waveforms.\
\>", "Text",
 CellChangeTimes->{{3.411923030345728*^9, 3.4119230576249533`*^9}, {
  3.44726829815625*^9, 3.44726830140625*^9}, {3.4472708905*^9, 
  3.447270895203125*^9}, {3.44727092846875*^9, 3.447270978609375*^9}, {
  3.447271017390625*^9, 3.447271055109375*^9}}],

Cell[BoxData[{
 RowBox[{"LogTest`TestName", "[", 
  "\"\<Setuponly reading two arrays of Voltages\>\"", 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"val0", " ", "=", " ", "1.23"}], ";", " ", 
  RowBox[{"val1", "=", "2.34"}], ";", " ", 
  RowBox[{"NN", " ", "=", " ", "1000"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thWrite0", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", "0", "}"}], ",", 
     RowBox[{"{", "0.0", "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thWrite1", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", "1", "}"}], ",", 
     RowBox[{"{", "0.0", "}"}], ",", "10", ",", "10", ",", 
     RowBox[{"SetupOnly", "\[Rule]", "True"}], ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite0", ",", "val0"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RunTask", "[", 
   RowBox[{"thWrite1", ",", "val1"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thTemp1", " ", "=", " ", 
   RowBox[{"GetVoltages", "[", 
    RowBox[{
     RowBox[{"{", "0", "}"}], ",", "10000.0", ",", "NN", ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
     RowBox[{"SetupOnly", "->", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"thTemp2", " ", "=", " ", 
   RowBox[{"GetVoltages", "[", 
    RowBox[{
     RowBox[{"{", "3", "}"}], ",", "10000.0", ",", "NN", ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
     RowBox[{"SetupOnly", "->", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"{", 
   RowBox[{"err1", ",", "err2"}], " ", "}"}], " ", "=", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"Abs", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"Total", "[", 
        RowBox[{"RunTask", "[", "thTemp1", "]"}], "]"}], "/", "1000"}], " ", 
      "-", "val0"}], "]"}], ",", " ", 
    RowBox[{"Abs", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"Total", "[", 
        RowBox[{"RunTask", "[", "thTemp2", "]"}], "]"}], "/", "1000"}], " ", 
      "-", "val1"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "thTemp1", "]"}], ";", 
  RowBox[{"ClearTask", "[", "thTemp2", "]"}], ";", 
  RowBox[{"ClearTask", "[", "thWrite0", "]"}], ";", 
  RowBox[{"ClearTask", "[", "thWrite1", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"{", 
  RowBox[{
   RowBox[{"err1", " ", "\[LessEqual]", ".02"}], ",", " ", 
   RowBox[{"err2", "\[LessEqual]", ".02"}]}], "}"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"(", 
   RowBox[{"err1", " ", "\[LessEqual]", ".02"}], ")"}], "&&", " ", 
  RowBox[{"(", 
   RowBox[{"err2", "\[LessEqual]", ".02"}], ")"}]}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{
   RowBox[{"(", 
    RowBox[{"err1", " ", "\[LessEqual]", ".01"}], ")"}], "&&", " ", 
   RowBox[{"(", 
    RowBox[{"err2", "\[LessEqual]", ".01"}], ")"}]}], "]"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.411923030345728*^9, 3.4119230576249533`*^9}, {
  3.44726829815625*^9, 3.44726830140625*^9}, {3.4472708905*^9, 
  3.447270895203125*^9}, {3.44727092846875*^9, 3.447270998203125*^9}, {
  3.447606582109375*^9, 3.44760665365625*^9}, {3.44760668625*^9, 
  3.447606691890625*^9}, {3.44760678715625*^9, 3.44760684346875*^9}, {
  3.447606882484375*^9, 3.447606896015625*^9}, {3.4476069515*^9, 
  3.44760697975*^9}, {3.447607026078125*^9, 3.44760710115625*^9}, {
  3.512594039875*^9, 3.512594075765625*^9}, {3.512594120953125*^9, 
  3.512594376125*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Check the VISA serial port", "Subtitle",
 CellChangeTimes->{{3.411923030345728*^9, 3.4119230576249533`*^9}, {
  3.44726829815625*^9, 3.44726830140625*^9}, {3.4472708905*^9, 
  3.447270895203125*^9}}],

Cell[TextData[{
 "Visa support not yet integrated into the ",
 StyleBox["Mathematica",
  FontSlant->"Italic"],
 " package.  This directly call the Cpp function"
}], "Text",
 CellChangeTimes->{{3.411923030345728*^9, 3.4119230576249533`*^9}, {
  3.44726829815625*^9, 3.44726836084375*^9}, {3.51267572278125*^9, 
  3.51267574346875*^9}}],

Cell[BoxData[{
 RowBox[{"LogTest`TestName", "[", "\"\<Serial Port test of Cpp function\>\"", 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"listforcall", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"\"\<messageToSend\>\"", ",", "\"\<Hello World\\a more\>\""}], 
      "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\"\<listenForReply\>\"", ",", "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\"\<messagelevel\>\"", ",", "0"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\"\<timeout\>\"", ",", "0.30"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\"\<timeoutIsErr\>\"", ",", "0"}], "}"}], ",", " ", 
     RowBox[{"{", 
      RowBox[{"\"\<charsToRead\>\"", ",", "30"}], "}"}], ",", " ", 
     RowBox[{"{", 
      RowBox[{"\"\<terminationChar\>\"", ",", "\"\<\\a\>\""}], "}"}]}], 
    "}"}]}], ";"}], "\n", 
 RowBox[{"response", " ", "=", " ", 
  RowBox[{
  "SerialPortCommunicateCpp", "[", "listforcall", 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{"response", "\[Equal]", " ", "\"\<Hello World\>\""}], 
  "]"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.411923030345728*^9, 3.411923032829299*^9}, {
   3.447267279515625*^9, 3.44726738221875*^9}, {3.44726742959375*^9, 
   3.447267527421875*^9}, {3.44726811175*^9, 3.4472681416875*^9}, 
   3.447268243484375*^9, {3.512675746828125*^9, 3.512675786109375*^9}, {
   3.51267583109375*^9, 3.5126758398125*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Software Triggering", "Subtitle",
 CellChangeTimes->{
  3.411924712594683*^9, {3.41229635789544*^9, 3.4122963953292675`*^9}, {
   3.4122965174048033`*^9, 3.4122965205593395`*^9}, {3.4122965533364706`*^9, 
   3.4122965590747213`*^9}, {3.447272873265625*^9, 3.447272973421875*^9}, {
   3.449247433390625*^9, 3.449247439390625*^9}}],

Cell[CellGroupData[{

Cell["Software Triggering Positive Slope", "Subsubtitle",
 CellChangeTimes->{
  3.411924712594683*^9, {3.41229635789544*^9, 3.4122963953292675`*^9}, {
   3.4122965174048033`*^9, 3.4122965205593395`*^9}, {3.4122965533364706`*^9, 
   3.4122965590747213`*^9}, {3.447272873265625*^9, 3.447272995484375*^9}, {
   3.44812070434375*^9, 3.448120709171875*^9}, {3.448121314*^9, 
   3.448121401078125*^9}, 3.4482137858125*^9}],

Cell["\<\
I think software triggering is taking some large number of samples regardless \
of the size of the requested buffer.
At 50KHZ: 5 samples takes .5 seconds
     500Hz: 5 samples takes 4 seconds\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.414506799397704*^9, 3.414506800128755*^9}, {
   3.4145068378730288`*^9, 3.4145068876646256`*^9}, {3.4145069495536175`*^9, 
   3.414507027916298*^9}, {3.4145071286211042`*^9, 3.414507133448045*^9}, {
   3.4145071735957747`*^9, 3.4145072054415665`*^9}, {3.414507236816682*^9, 
   3.4145072656581535`*^9}, {3.414507319175107*^9, 3.414507368586157*^9}, {
   3.414507688105603*^9, 3.414507722585182*^9}, {3.4145077586470366`*^9, 
   3.4145077763725247`*^9}, {3.4145078499383073`*^9, 
   3.4145078524218783`*^9}, {3.4145079016726975`*^9, 3.414507944454214*^9}, {
   3.414508064416712*^9, 3.414508176107315*^9}, {3.414508207973136*^9, 
   3.414508416272656*^9}, {3.414508470580747*^9, 3.414508485241829*^9}, {
   3.414508547110792*^9, 3.414508654585333*^9}, {3.414508706059349*^9, 
   3.4145087062696514`*^9}, {3.414508750933875*^9, 3.4145088117913837`*^9}, 
   3.414508846441208*^9, {3.447271776265625*^9, 3.44727178428125*^9}, {
   3.447271831625*^9, 3.4472718340625*^9}, {3.447271866890625*^9, 
   3.447271867453125*^9}, {3.447271901953125*^9, 3.447271902875*^9}, {
   3.4472719354375*^9, 3.447271947640625*^9}, {3.447272027953125*^9, 
   3.447272037609375*^9}, {3.4472721445*^9, 3.4472721893125*^9}, {
   3.44727224209375*^9, 3.44727231546875*^9}, {3.447272352265625*^9, 
   3.447272378671875*^9}, {3.447272416046875*^9, 3.44727285365625*^9}, {
   3.447273004234375*^9, 3.4472730575625*^9}, {3.44727309365625*^9, 
   3.447273157046875*^9}, {3.447273315796875*^9, 3.447273402859375*^9}, {
   3.44727359053125*^9, 3.44727390309375*^9}, {3.4472742051875*^9, 
   3.44727429221875*^9}, {3.447274324375*^9, 3.44727441753125*^9}, {
   3.447274708390625*^9, 3.44727471046875*^9}, {3.447437891828125*^9, 
   3.44743789296875*^9}, 3.447437952359375*^9, {3.4474380420625*^9, 
   3.44743807025*^9}, {3.447438704328125*^9, 3.44743872309375*^9}, 
   3.447438781453125*^9, {3.447444662171875*^9, 3.4474446806875*^9}, {
   3.447445735671875*^9, 3.44744573590625*^9}, {3.447601173640625*^9, 
   3.447601195765625*^9}, {3.44760163615625*^9, 3.44760165190625*^9}, {
   3.448121168765625*^9, 3.448121226078125*^9}, {3.4481316695957355`*^9, 
   3.4481316913769855`*^9}, {3.4481317566582355`*^9, 
   3.4481317573144855`*^9}, {3.4481349503613605`*^9, 
   3.4481349531113605`*^9}, {3.4481351257363605`*^9, 
   3.4481351822051105`*^9}, {3.448213680625*^9, 3.448213680921875*^9}, {
   3.448213898859375*^9, 3.44821389921875*^9}, 3.512675889859375*^9, {
   3.51267598803125*^9, 3.5126760236875*^9}, {3.512676243078125*^9, 
   3.512676278171875*^9}, {3.512676316828125*^9, 3.512676370421875*^9}, {
   3.5126771075*^9, 3.512677140515625*^9}, {3.512679149765625*^9, 
   3.51267915603125*^9}, {3.51267923828125*^9, 3.512679289375*^9}, {
   3.51267932453125*^9, 3.512679346171875*^9}, {3.51267939046875*^9, 
   3.512679571484375*^9}, {3.512679636609375*^9, 3.512679637953125*^9}, {
   3.512679771984375*^9, 3.512679823203125*^9}, {3.51267990125*^9, 
   3.512679901375*^9}, {3.51267995371875*^9, 3.512679953828125*^9}, 
   3.512679991109375*^9, 3.512680024796875*^9, {3.51268007065625*^9, 
   3.512680158359375*^9}, {3.51268033684375*^9, 3.51268041596875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", "\"\<Testing GetVoltagesTrig Positive Slope\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"numPts", "=", "100"}], ";", " ", 
   RowBox[{"fout", " ", "=", " ", "10000.0"}], ";"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "p1", "]"}], ";", 
  RowBox[{"Clear", "[", "p2", "]"}], ";", 
  RowBox[{"data2", "=", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"data", " ", "=", " ", 
   RowBox[{"Transpose", "[", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Sin", "[", "x", "]"}], ",", 
         RowBox[{"Cos", "[", "x", "]"}]}], "}"}], "//", "N"}], ",", 
      RowBox[{"{", 
       RowBox[{"x", ",", "0", ",", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{"2", "*", " ", "Pi"}], ")"}], "*", 
         RowBox[{"(", 
          RowBox[{"1", "-", 
           RowBox[{"1", "/", "numPts"}]}], ")"}]}], ",", 
        RowBox[{"2", "*", 
         RowBox[{"Pi", "/", "numPts"}]}]}], "}"}]}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"t1", " ", "=", " ", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"th", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", "data", ",", " ", "fout", ",", "1",
      ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
     RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "Interrupts"}], ",", 
     RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Print", "[", 
    RowBox[{"\"\<Output takes:\>\"", ",", " ", 
     RowBox[{
      RowBox[{"AbsoluteTime", "[", "]"}], "-", "t1"}]}], "]"}], ";"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"data2", " ", "=", " ", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", "10000.0", ",", "2000", ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "Interrupts"}]}], 
      "]"}]}], ";"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t1", " ", "=", " ", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Pause", "[", ".1", "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{"\"\<Pause takes:\>\"", ",", " ", 
    RowBox[{
     RowBox[{"AbsoluteTime", "[", "]"}], "-", "t1"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", 
   RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Table", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"(", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"t1", " ", "=", " ", 
       RowBox[{"AbsoluteTime", "[", "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"data2", " ", "=", " ", 
       RowBox[{"GetVoltagesTrig", "[", 
        RowBox[{
         RowBox[{"{", "0", "}"}], ",", "50000.0", ",", "500", ",", "0", ",", 
         "triggerLevel", ",", " ", 
         RowBox[{"TriggerSlope", "\[Rule]", "Rising"}], ",", " ", 
         RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
         RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}]}], "]"}]}], ";",
       "\[IndentingNewLine]", 
      RowBox[{"Print", "[", 
       RowBox[{"\"\<acquistion takes:\>\"", ",", " ", 
        RowBox[{
         RowBox[{"AbsoluteTime", "[", "]"}], "-", "t1"}]}], "]"}], ";", 
      "\[IndentingNewLine]", " ", 
      RowBox[{"Print", "[", " ", 
       RowBox[{"triggerLevel", ",", "\"\< --> \>\"", ",", " ", 
        RowBox[{
         RowBox[{"data2", "[", 
          RowBox[{"[", "1", "]"}], "]"}], "[", 
         RowBox[{"[", "2", "]"}], "]"}]}], "]"}], " ", ";", 
      "\[IndentingNewLine]", 
      RowBox[{"p1", " ", "=", " ", 
       RowBox[{"ListPlot", "[", "data2", "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"cond", " ", "=", " ", 
       RowBox[{"Append", "[", 
        RowBox[{"cond", ",", 
         RowBox[{
          RowBox[{
           RowBox[{
            RowBox[{"data2", "[", 
             RowBox[{"[", "1", "]"}], "]"}], "[", 
            RowBox[{"[", "2", "]"}], "]"}], " ", "-", " ", "triggerLevel"}], 
          " ", ">=", "0"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"cond", " ", "=", " ", 
       RowBox[{"Append", "[", 
        RowBox[{"cond", ",", " ", 
         RowBox[{
          RowBox[{
           RowBox[{
            RowBox[{"data2", "[", 
             RowBox[{"[", "1", "]"}], "]"}], "[", 
            RowBox[{"[", "2", "]"}], "]"}], " ", "-", " ", "triggerLevel"}], 
          " ", "\[LessEqual]", " ", 
          RowBox[{
           RowBox[{"(", " ", 
            RowBox[{
             RowBox[{
              RowBox[{"data", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "[", 
              RowBox[{"[", "2", "]"}], "]"}], "-", " ", 
             RowBox[{
              RowBox[{"data", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "[", 
              RowBox[{"[", "1", "]"}], "]"}]}], ")"}], "*", "1.5"}]}]}], 
        "]"}]}], ";"}], "\[IndentingNewLine]", ")"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{"triggerLevel", ",", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"-", ".2"}], ",", "0.2", ",", ".5"}], "}"}]}], "}"}]}], "]"}],
   ";"}], "\[IndentingNewLine]", 
 RowBox[{"cond", "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p2", " ", "=", 
   RowBox[{"ListPlot", "[", 
    RowBox[{
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"i", "/", "fout"}], ",", 
         RowBox[{
          RowBox[{"data", "[", 
           RowBox[{"[", "1", "]"}], "]"}], "[", 
          RowBox[{"[", "i", "]"}], "]"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", "1", ",", 
         RowBox[{"numPts", "-", "1"}]}], "}"}]}], "]"}], ",", 
     RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Show", "[", 
  RowBox[{"p1", ",", "p2"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{"And", " ", "@@", " ", "cond"}], "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.414506799397704*^9, 3.414506800128755*^9}, {
   3.4145068378730288`*^9, 3.4145068876646256`*^9}, {3.4145069495536175`*^9, 
   3.414507027916298*^9}, {3.4145071286211042`*^9, 3.414507133448045*^9}, {
   3.4145071735957747`*^9, 3.4145072054415665`*^9}, {3.414507236816682*^9, 
   3.4145072656581535`*^9}, {3.414507319175107*^9, 3.414507368586157*^9}, {
   3.414507688105603*^9, 3.414507722585182*^9}, {3.4145077586470366`*^9, 
   3.4145077763725247`*^9}, {3.4145078499383073`*^9, 
   3.4145078524218783`*^9}, {3.4145079016726975`*^9, 3.414507944454214*^9}, {
   3.414508064416712*^9, 3.414508176107315*^9}, {3.414508207973136*^9, 
   3.414508416272656*^9}, {3.414508470580747*^9, 3.414508485241829*^9}, {
   3.414508547110792*^9, 3.414508654585333*^9}, {3.414508706059349*^9, 
   3.4145087062696514`*^9}, {3.414508750933875*^9, 3.4145088117913837`*^9}, 
   3.414508846441208*^9, {3.447271776265625*^9, 3.44727178428125*^9}, {
   3.447271831625*^9, 3.4472718340625*^9}, {3.447271866890625*^9, 
   3.447271867453125*^9}, {3.447271901953125*^9, 3.447271902875*^9}, {
   3.4472719354375*^9, 3.447271947640625*^9}, {3.447272027953125*^9, 
   3.447272037609375*^9}, {3.4472721445*^9, 3.4472721893125*^9}, {
   3.44727224209375*^9, 3.44727231546875*^9}, {3.447272352265625*^9, 
   3.447272378671875*^9}, {3.447272416046875*^9, 3.44727285365625*^9}, {
   3.447273004234375*^9, 3.4472730575625*^9}, {3.44727309365625*^9, 
   3.447273157046875*^9}, {3.447273315796875*^9, 3.447273402859375*^9}, {
   3.44727359053125*^9, 3.44727390309375*^9}, {3.4472742051875*^9, 
   3.44727429221875*^9}, {3.447274324375*^9, 3.44727441753125*^9}, {
   3.447274708390625*^9, 3.44727471046875*^9}, {3.447437891828125*^9, 
   3.44743789296875*^9}, 3.447437952359375*^9, {3.4474380420625*^9, 
   3.44743807025*^9}, {3.447438704328125*^9, 3.44743872309375*^9}, 
   3.447438781453125*^9, {3.447444662171875*^9, 3.4474446806875*^9}, {
   3.447445735671875*^9, 3.44744573590625*^9}, {3.447601173640625*^9, 
   3.447601195765625*^9}, {3.44760163615625*^9, 3.44760165190625*^9}, {
   3.448121168765625*^9, 3.448121226078125*^9}, {3.4481316695957355`*^9, 
   3.4481316913769855`*^9}, {3.4481317566582355`*^9, 
   3.4481317573144855`*^9}, {3.4481349503613605`*^9, 
   3.4481349531113605`*^9}, {3.4481351257363605`*^9, 
   3.4481351822051105`*^9}, {3.448213680625*^9, 3.448213680921875*^9}, {
   3.448213898859375*^9, 3.44821389921875*^9}, 3.512675889859375*^9, {
   3.51267598803125*^9, 3.5126760236875*^9}, {3.512676243078125*^9, 
   3.512676278171875*^9}, {3.512676316828125*^9, 3.512676370421875*^9}, {
   3.5126771075*^9, 3.512677140515625*^9}, {3.512679149765625*^9, 
   3.51267915603125*^9}, {3.51267923828125*^9, 3.512679289375*^9}, {
   3.51267932453125*^9, 3.512679346171875*^9}, {3.51267939046875*^9, 
   3.512679571484375*^9}, {3.512679636609375*^9, 3.512679637953125*^9}, {
   3.512679771984375*^9, 3.512679823203125*^9}, {3.51267990125*^9, 
   3.512679901375*^9}, {3.51267995371875*^9, 3.512679953828125*^9}, 
   3.512679991109375*^9, 3.512680024796875*^9, {3.51268007065625*^9, 
   3.5126800745625*^9}, 3.51268016853125*^9, {3.512680216359375*^9, 
   3.512680219921875*^9}, 3.512680252203125*^9, {3.512680514984375*^9, 
   3.512680526*^9}, {3.512680690625*^9, 3.512680779875*^9}, 
   3.51268083728125*^9, 3.51268087628125*^9, {3.5126809159375*^9, 
   3.512680936265625*^9}, {3.512680967890625*^9, 3.5126809680625*^9}, 
   3.51268109196875*^9}]
}, Closed]],

Cell[CellGroupData[{

Cell["Check pretrigger samples", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.414506799397704*^9, 3.414506800128755*^9}, {
   3.4145068378730288`*^9, 3.4145068876646256`*^9}, {3.4145069495536175`*^9, 
   3.414507027916298*^9}, {3.4145071286211042`*^9, 3.414507133448045*^9}, {
   3.4145071735957747`*^9, 3.4145072054415665`*^9}, {3.414507236816682*^9, 
   3.4145072656581535`*^9}, {3.414507319175107*^9, 3.414507368586157*^9}, {
   3.414507688105603*^9, 3.414507722585182*^9}, {3.4145077586470366`*^9, 
   3.4145077763725247`*^9}, {3.4145078499383073`*^9, 
   3.4145078524218783`*^9}, {3.4145079016726975`*^9, 3.414507944454214*^9}, {
   3.414508064416712*^9, 3.414508176107315*^9}, {3.414508207973136*^9, 
   3.414508416272656*^9}, {3.414508470580747*^9, 3.414508485241829*^9}, {
   3.414508547110792*^9, 3.414508654585333*^9}, {3.414508706059349*^9, 
   3.4145087062696514`*^9}, {3.414508750933875*^9, 3.4145088117913837`*^9}, 
   3.414508846441208*^9, {3.447271776265625*^9, 3.44727178428125*^9}, {
   3.447271831625*^9, 3.4472718340625*^9}, {3.447271866890625*^9, 
   3.447271867453125*^9}, {3.447271901953125*^9, 3.447271902875*^9}, {
   3.4472719354375*^9, 3.447271947640625*^9}, {3.447272027953125*^9, 
   3.447272037609375*^9}, {3.4472721445*^9, 3.4472721893125*^9}, {
   3.44727224209375*^9, 3.44727231546875*^9}, {3.447272352265625*^9, 
   3.447272378671875*^9}, {3.447272416046875*^9, 3.44727285365625*^9}, {
   3.447273004234375*^9, 3.4472730575625*^9}, {3.44727309365625*^9, 
   3.447273157046875*^9}, {3.447273315796875*^9, 3.447273402859375*^9}, {
   3.44727359053125*^9, 3.44727390309375*^9}, {3.4472742051875*^9, 
   3.44727429221875*^9}, {3.447274324375*^9, 3.44727441753125*^9}, {
   3.447274708390625*^9, 3.44727471046875*^9}, {3.447437891828125*^9, 
   3.44743789296875*^9}, 3.447437952359375*^9, {3.4474380420625*^9, 
   3.44743807025*^9}, {3.447438704328125*^9, 3.44743872309375*^9}, 
   3.447438781453125*^9, {3.447444662171875*^9, 3.4474446806875*^9}, {
   3.447445735671875*^9, 3.44744573590625*^9}, {3.447601173640625*^9, 
   3.447601195765625*^9}, {3.44760163615625*^9, 3.44760165190625*^9}, {
   3.447601692453125*^9, 3.44760171034375*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Checking trigger level is between pre and post trigger data\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"numPts", "=", "200"}], ";", " ", 
   RowBox[{"fout", " ", "=", " ", "10000.0"}], ";"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", 
   RowBox[{"ans", ",", " ", "cond"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "p1", "]"}], ";", 
  RowBox[{"Clear", "[", "p2", "]"}], ";", 
  RowBox[{"data2", "=", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"data", " ", "=", " ", 
   RowBox[{"Transpose", "[", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Sin", "[", "x", "]"}], ",", 
         RowBox[{"Cos", "[", "x", "]"}]}], "}"}], "//", "N"}], ",", 
      RowBox[{"{", 
       RowBox[{"x", ",", "0", ",", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{"2", "*", " ", "Pi"}], ")"}], "*", 
         RowBox[{"(", 
          RowBox[{"1", "-", 
           RowBox[{"1", "/", "numPts"}]}], ")"}]}], ",", 
        RowBox[{"2", "*", 
         RowBox[{"Pi", "/", "numPts"}]}]}], "}"}]}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"th", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", "data", ",", " ", "fout", ",", "1",
      ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
     RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
     RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"preNum", " ", "=", " ", "10"}], ";", " ", 
  RowBox[{"postNum", " ", "=", "5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"ans", " ", "=", " ", 
    RowBox[{"GetVoltagesTrig", "[", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", "10000.0", ",", 
      RowBox[{"postTriggerSamples", " ", "=", " ", "5"}], ",", "0", ",", 
      RowBox[{"triggerLevel", "=", "0.0"}], ",", 
      RowBox[{"PreTriggerSamples", "\[Rule]", "10"}], ",", 
      RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
      RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}], ",", " ", 
      RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}]}], ";"}], "  ", 
  RowBox[{"(*", " ", 
   RowBox[{
   "Note", " ", "sample", " ", "mode", " ", "currently", " ", "hard", " ", 
    "wired", " ", "to", " ", "continuous"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"{", 
   RowBox[{
    RowBox[{"ans", "[", 
     RowBox[{"[", "preNum", "]"}], "]"}], ",", " ", "triggerLevel", ",", 
    RowBox[{"ans", "[", 
     RowBox[{"[", 
      RowBox[{"preNum", "+", "1"}], "]"}], "]"}]}], "}"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", " ", 
   RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"cond", ",", 
     RowBox[{
      RowBox[{"Length", "[", "ans", "]"}], " ", "\[Equal]", " ", 
      RowBox[{"preNum", " ", "+", " ", "postNum"}]}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"cond", ",", " ", 
     RowBox[{
      RowBox[{"ans", "[", 
       RowBox[{"[", "preNum", "]"}], "]"}], "<", " ", "triggerLevel", "<", 
      " ", 
      RowBox[{"ans", "[", 
       RowBox[{"[", 
        RowBox[{"preNum", "+", "1"}], "]"}], "]"}]}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{"And", " ", "@@", " ", "cond"}], "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.414506799397704*^9, 3.414506800128755*^9}, {
   3.4145068378730288`*^9, 3.4145068876646256`*^9}, {3.4145069495536175`*^9, 
   3.414507027916298*^9}, {3.4145071286211042`*^9, 3.414507133448045*^9}, {
   3.4145071735957747`*^9, 3.4145072054415665`*^9}, {3.414507236816682*^9, 
   3.4145072656581535`*^9}, {3.414507319175107*^9, 3.414507368586157*^9}, {
   3.414507688105603*^9, 3.414507722585182*^9}, {3.4145077586470366`*^9, 
   3.4145077763725247`*^9}, {3.4145078499383073`*^9, 
   3.4145078524218783`*^9}, {3.4145079016726975`*^9, 3.414507944454214*^9}, {
   3.414508064416712*^9, 3.414508176107315*^9}, {3.414508207973136*^9, 
   3.414508416272656*^9}, {3.414508470580747*^9, 3.414508485241829*^9}, {
   3.414508547110792*^9, 3.414508654585333*^9}, {3.414508706059349*^9, 
   3.4145087062696514`*^9}, {3.414508750933875*^9, 3.4145088117913837`*^9}, 
   3.414508846441208*^9, {3.447271776265625*^9, 3.44727178428125*^9}, {
   3.447271831625*^9, 3.4472718340625*^9}, {3.447271866890625*^9, 
   3.447271867453125*^9}, {3.447271901953125*^9, 3.447271902875*^9}, {
   3.4472719354375*^9, 3.447271947640625*^9}, {3.447272027953125*^9, 
   3.447272037609375*^9}, {3.4472721445*^9, 3.4472721893125*^9}, {
   3.44727224209375*^9, 3.44727231546875*^9}, {3.447272352265625*^9, 
   3.447272378671875*^9}, {3.447272416046875*^9, 3.44727285365625*^9}, {
   3.447273004234375*^9, 3.4472730575625*^9}, {3.44727309365625*^9, 
   3.447273157046875*^9}, {3.447273315796875*^9, 3.447273402859375*^9}, {
   3.44727359053125*^9, 3.44727390309375*^9}, {3.4472742051875*^9, 
   3.44727429221875*^9}, {3.447274324375*^9, 3.44727441753125*^9}, {
   3.447274708390625*^9, 3.44727471046875*^9}, {3.447437891828125*^9, 
   3.44743789296875*^9}, 3.447437952359375*^9, {3.4474380420625*^9, 
   3.44743807025*^9}, {3.447438704328125*^9, 3.44743872309375*^9}, 
   3.447438781453125*^9, {3.447444662171875*^9, 3.4474446806875*^9}, {
   3.447445735671875*^9, 3.44744573590625*^9}, {3.447601173640625*^9, 
   3.447601195765625*^9}, {3.44760163615625*^9, 3.44760163934375*^9}, {
   3.44760176178125*^9, 3.447601775*^9}, {3.447601815140625*^9, 
   3.447601845140625*^9}, {3.447601925140625*^9, 3.44760203725*^9}, {
   3.447602626*^9, 3.44760262621875*^9}, {3.447602660421875*^9, 
   3.4476026658125*^9}, {3.44760360675*^9, 3.44760362478125*^9}, {
   3.447603681515625*^9, 3.4476037170625*^9}, {3.447604765328125*^9, 
   3.447604777578125*^9}, {3.447609275140625*^9, 3.447609374390625*^9}, {
   3.447609408171875*^9, 3.447609488109375*^9}, {3.44760953984375*^9, 
   3.447609543359375*^9}, {3.44760957959375*^9, 3.4476096209375*^9}, {
   3.447609684953125*^9, 3.447609707390625*^9}, {3.447609744265625*^9, 
   3.44760981453125*^9}, {3.447609916765625*^9, 3.447609917234375*^9}, {
   3.447609954703125*^9, 3.44760998009375*^9}, 3.447610023765625*^9, {
   3.447610087453125*^9, 3.447610091984375*^9}, {3.447610147125*^9, 
   3.4476101840625*^9}, {3.447610251484375*^9, 3.447610470203125*^9}, {
   3.4476105015625*^9, 3.447610552578125*^9}, {3.447610603640625*^9, 
   3.447610775328125*^9}, {3.44761081928125*^9, 3.44761093390625*^9}, 
   3.447610980890625*^9, {3.447611037359375*^9, 3.44761106*^9}, {
   3.447611095171875*^9, 3.447611131765625*^9}, {3.4481350042832355`*^9, 
   3.4481350044394855`*^9}, {3.448213690453125*^9, 3.448213690875*^9}, {
   3.449252132823286*^9, 3.4492521332139664`*^9}, {3.4492522593879795`*^9, 
   3.4492522595598783`*^9}, {3.44925230481625*^9, 3.4492523196620893`*^9}, {
   3.512675946375*^9, 3.51267594921875*^9}, {3.51267646471875*^9, 
   3.512676518546875*^9}, {3.512680574375*^9, 3.51268057459375*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Check multiple channels using Software Trigger", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.414506799397704*^9, 3.414506800128755*^9}, {
   3.4145068378730288`*^9, 3.4145068876646256`*^9}, {3.4145069495536175`*^9, 
   3.414507027916298*^9}, {3.4145071286211042`*^9, 3.414507133448045*^9}, {
   3.4145071735957747`*^9, 3.4145072054415665`*^9}, {3.414507236816682*^9, 
   3.4145072656581535`*^9}, {3.414507319175107*^9, 3.414507368586157*^9}, {
   3.414507688105603*^9, 3.414507722585182*^9}, {3.4145077586470366`*^9, 
   3.4145077763725247`*^9}, {3.4145078499383073`*^9, 
   3.4145078524218783`*^9}, {3.4145079016726975`*^9, 3.414507944454214*^9}, {
   3.414508064416712*^9, 3.414508176107315*^9}, {3.414508207973136*^9, 
   3.414508416272656*^9}, {3.414508470580747*^9, 3.414508485241829*^9}, {
   3.414508547110792*^9, 3.414508654585333*^9}, {3.414508706059349*^9, 
   3.4145087062696514`*^9}, {3.414508750933875*^9, 3.4145088117913837`*^9}, 
   3.414508846441208*^9, {3.447271776265625*^9, 3.44727178428125*^9}, {
   3.447271831625*^9, 3.4472718340625*^9}, {3.447271866890625*^9, 
   3.447271867453125*^9}, {3.447271901953125*^9, 3.447271902875*^9}, {
   3.4472719354375*^9, 3.447271947640625*^9}, {3.447272027953125*^9, 
   3.447272037609375*^9}, {3.4472721445*^9, 3.4472721893125*^9}, {
   3.44727224209375*^9, 3.44727231546875*^9}, {3.447272352265625*^9, 
   3.447272378671875*^9}, {3.447272416046875*^9, 3.44727285365625*^9}, {
   3.447273004234375*^9, 3.4472730575625*^9}, {3.44727309365625*^9, 
   3.447273157046875*^9}, {3.447273315796875*^9, 3.447273402859375*^9}, {
   3.44727359053125*^9, 3.44727390309375*^9}, {3.4472742051875*^9, 
   3.44727429221875*^9}, {3.447274324375*^9, 3.44727441753125*^9}, {
   3.447274708390625*^9, 3.44727471046875*^9}, {3.447437891828125*^9, 
   3.44743789296875*^9}, 3.447437952359375*^9, {3.4474380420625*^9, 
   3.44743807025*^9}, {3.447438704328125*^9, 3.44743872309375*^9}, 
   3.447438781453125*^9, {3.447444662171875*^9, 3.4474446806875*^9}, {
   3.447445735671875*^9, 3.44744573590625*^9}, {3.447601173640625*^9, 
   3.447601195765625*^9}, {3.44760163615625*^9, 3.44760163934375*^9}, {
   3.44760176178125*^9, 3.447601775*^9}, {3.447601815140625*^9, 
   3.447601845140625*^9}, {3.447601925140625*^9, 3.44760203725*^9}, {
   3.447602626*^9, 3.44760262621875*^9}, {3.447602660421875*^9, 
   3.4476026658125*^9}, {3.44760360675*^9, 3.44760362478125*^9}, {
   3.447603681515625*^9, 3.4476037170625*^9}, {3.447604765328125*^9, 
   3.447604777578125*^9}, {3.447609275140625*^9, 3.447609374390625*^9}, {
   3.447609408171875*^9, 3.447609488109375*^9}, {3.44760953984375*^9, 
   3.447609543359375*^9}, {3.44760957959375*^9, 3.4476096209375*^9}, {
   3.447609684953125*^9, 3.447609707390625*^9}, {3.447609744265625*^9, 
   3.44760981453125*^9}, {3.447609916765625*^9, 3.447609917234375*^9}, {
   3.447609954703125*^9, 3.44760998009375*^9}, 3.447610023765625*^9, {
   3.447610087453125*^9, 3.447610091984375*^9}, {3.447610147125*^9, 
   3.4476101840625*^9}, {3.447610251484375*^9, 3.447610470203125*^9}, {
   3.4476105015625*^9, 3.447610552578125*^9}, {3.447610603640625*^9, 
   3.447610775328125*^9}, {3.44761081928125*^9, 3.447610943140625*^9}, {
   3.4476109876875*^9, 3.447611009703125*^9}, {3.4477070038125*^9, 
   3.447707009859375*^9}}],

Cell["\<\
Chech that data on second channel is correct recorded both pre and post trigger
Checking for values right on trigger edge will cause occansional failure \
should this change or try different sample rate ratios?\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.414506799397704*^9, 3.414506800128755*^9}, {
   3.4145068378730288`*^9, 3.4145068876646256`*^9}, {3.4145069495536175`*^9, 
   3.414507027916298*^9}, {3.4145071286211042`*^9, 3.414507133448045*^9}, {
   3.4145071735957747`*^9, 3.4145072054415665`*^9}, {3.414507236816682*^9, 
   3.4145072656581535`*^9}, {3.414507319175107*^9, 3.414507368586157*^9}, {
   3.414507688105603*^9, 3.414507722585182*^9}, {3.4145077586470366`*^9, 
   3.4145077763725247`*^9}, {3.4145078499383073`*^9, 
   3.4145078524218783`*^9}, {3.4145079016726975`*^9, 3.414507944454214*^9}, {
   3.414508064416712*^9, 3.414508176107315*^9}, {3.414508207973136*^9, 
   3.414508416272656*^9}, {3.414508470580747*^9, 3.414508485241829*^9}, {
   3.414508547110792*^9, 3.414508654585333*^9}, {3.414508706059349*^9, 
   3.4145087062696514`*^9}, {3.414508750933875*^9, 3.4145088117913837`*^9}, 
   3.414508846441208*^9, {3.447271776265625*^9, 3.44727178428125*^9}, {
   3.447271831625*^9, 3.4472718340625*^9}, {3.447271866890625*^9, 
   3.447271867453125*^9}, {3.447271901953125*^9, 3.447271902875*^9}, {
   3.4472719354375*^9, 3.447271947640625*^9}, {3.447272027953125*^9, 
   3.447272037609375*^9}, {3.4472721445*^9, 3.4472721893125*^9}, {
   3.44727224209375*^9, 3.44727231546875*^9}, {3.447272352265625*^9, 
   3.447272378671875*^9}, {3.447272416046875*^9, 3.44727285365625*^9}, {
   3.447273004234375*^9, 3.4472730575625*^9}, {3.44727309365625*^9, 
   3.447273157046875*^9}, {3.447273315796875*^9, 3.447273402859375*^9}, {
   3.44727359053125*^9, 3.44727390309375*^9}, {3.4472742051875*^9, 
   3.44727429221875*^9}, {3.447274324375*^9, 3.44727441753125*^9}, {
   3.447274708390625*^9, 3.44727471046875*^9}, {3.447437891828125*^9, 
   3.44743789296875*^9}, 3.447437952359375*^9, {3.4474380420625*^9, 
   3.44743807025*^9}, {3.447438704328125*^9, 3.44743872309375*^9}, 
   3.447438781453125*^9, {3.447444662171875*^9, 3.4474446806875*^9}, {
   3.447445735671875*^9, 3.44744573590625*^9}, {3.447601173640625*^9, 
   3.447601195765625*^9}, {3.44760163615625*^9, 3.44760163934375*^9}, {
   3.44760176178125*^9, 3.447601775*^9}, {3.447601815140625*^9, 
   3.447601845140625*^9}, {3.447601925140625*^9, 3.44760203725*^9}, {
   3.447602626*^9, 3.44760262621875*^9}, {3.447602660421875*^9, 
   3.4476026658125*^9}, {3.44760360675*^9, 3.44760362478125*^9}, {
   3.447603681515625*^9, 3.4476037170625*^9}, {3.447604765328125*^9, 
   3.447604777578125*^9}, {3.447609275140625*^9, 3.447609374390625*^9}, {
   3.447609408171875*^9, 3.447609488109375*^9}, {3.44760953984375*^9, 
   3.447609543359375*^9}, {3.44760957959375*^9, 3.4476096209375*^9}, {
   3.447609684953125*^9, 3.447609707390625*^9}, {3.447609744265625*^9, 
   3.44760981453125*^9}, {3.447609916765625*^9, 3.447609917234375*^9}, {
   3.447609954703125*^9, 3.44760998009375*^9}, 3.447610023765625*^9, {
   3.447610087453125*^9, 3.447610091984375*^9}, {3.447610147125*^9, 
   3.4476101840625*^9}, {3.447610251484375*^9, 3.447610470203125*^9}, {
   3.4476105015625*^9, 3.447610552578125*^9}, {3.447610603640625*^9, 
   3.447610775328125*^9}, {3.44761081928125*^9, 3.447610943140625*^9}, {
   3.4476109876875*^9, 3.447611009703125*^9}, {3.4477070038125*^9, 
   3.4477070774375*^9}, {3.4477727798125*^9, 3.447772896125*^9}}],

Cell[BoxData[
 RowBox[{"\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
    "LogTest`TestName", "[", 
     "\"\<SoftwareTriggering multiple Channels with PreTrigger Samples\>\"", 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Clear", "[", 
     RowBox[{"ans", ",", " ", "cond"}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"numPts", "=", "500"}], ";", " ", 
    RowBox[{"fout", " ", "=", " ", "1000.0"}], ";", " ", 
    RowBox[{"Clear", "[", 
     RowBox[{"ans", ",", " ", "cond", ",", " ", "p1", ",", "p2"}], "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"eps", " ", "=", 
     RowBox[{"1.0", " ", "*", " ", 
      SuperscriptBox["10", 
       RowBox[{"-", "2"}]]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"waveOut", " ", "=", " ", 
    RowBox[{"Transpose", "[", 
     RowBox[{"Join", "[", 
      RowBox[{
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0.0", ",", 
           RowBox[{"-", "2.0"}]}], "}"}], ",", 
         RowBox[{"{", "10", "}"}]}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"{", 
         RowBox[{"1.0", ",", 
          RowBox[{"-", "1.0"}]}], "}"}], "}"}], ",", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0.4", ",", 
           RowBox[{"-", "1.5"}]}], "}"}], ",", 
         RowBox[{"{", "10", "}"}]}], "]"}]}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"th", " ", "=", " ", 
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", "1"}], "}"}], ",", "waveOut", ",", " ", "fout", ",",
        "1", ",", 
       RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
       RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ans", " ", "=", " ", 
     RowBox[{"GetVoltagesTrig", "[", 
      RowBox[{
       RowBox[{"channels", " ", "=", 
        RowBox[{"{", 
         RowBox[{"0", ",", "3", ",", "1"}], "}"}]}], ",", "10000.0", ",", 
       RowBox[{"postTriggerSamples", " ", "=", " ", "50"}], ",", "0", ",", 
       RowBox[{"triggerLevel", "=", "0.5"}], ",", 
       RowBox[{"PreTriggerSamples", "\[Rule]", 
        RowBox[{"(", 
         RowBox[{"preTrigSamples", " ", "=", " ", "15"}], ")"}]}], ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}], ",", " ", 
       RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cond", " ", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cond", " ", "=", 
     RowBox[{"Append", "[", 
      RowBox[{"cond", ",", 
       RowBox[{
        RowBox[{"Dimensions", "[", "ans", "]"}], "\[Equal]", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"Length", "[", "channels", "]"}], ",", " ", 
          RowBox[{"postTriggerSamples", "+", "preTrigSamples"}]}], "}"}]}]}], 
      "]"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cond", " ", "=", " ", 
     RowBox[{"Append", "[", 
      RowBox[{"cond", ",", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"Abs", "[", 
           RowBox[{
            RowBox[{"Part", "[", 
             RowBox[{"ans", ",", "1", ",", "preTrigSamples"}], "]"}], "-", 
            " ", "0.0"}], " ", "]"}], " ", "<", " ", "eps"}], ")"}], " ", "||",
         "                                 ", 
        RowBox[{"(*", " ", 
         RowBox[{
         "last", " ", "pretrigger", " ", "samples", " ", "trigger", " ", 
          "channel"}], " ", "*)"}], "\[IndentingNewLine]", "\t\t\t\t\t", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"Abs", "[", 
           RowBox[{
            RowBox[{"Part", "[", 
             RowBox[{"ans", ",", "1", ",", 
              RowBox[{"preTrigSamples", "-", "1"}]}], "]"}], "-", " ", 
            "0.0"}], " ", "]"}], " ", "<", " ", "eps"}], ")"}]}]}], "]"}]}], 
    ";"}], "                   ", 
   RowBox[{"(*", " ", 
    RowBox[{
    "one", " ", "previous", " ", "to", " ", "allow", " ", "for", " ", 
     "finite", " ", "rise", " ", "timing"}], " ", "*)"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cond", " ", "=", " ", 
     RowBox[{"Append", "[", 
      RowBox[{"cond", ",", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"Abs", "[", 
           RowBox[{
            RowBox[{"Part", "[", 
             RowBox[{"ans", ",", "2", ",", "preTrigSamples"}], "]"}], " ", 
            "-", " ", 
            RowBox[{"(", 
             RowBox[{"-", "2.0"}], ")"}]}], "]"}], " ", "<", "eps"}], ")"}], 
        " ", "||", "                            ", 
        RowBox[{"(*", " ", 
         RowBox[{
          RowBox[{
          "last", " ", "pretrigger", " ", "sample", " ", "first", " ", 
           "NON"}], "-", 
          RowBox[{"triggger", " ", "channel"}]}], " ", "*)"}], 
        "\[IndentingNewLine]", "\t\t\t", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"Abs", "[", 
           RowBox[{
            RowBox[{"Part", "[", 
             RowBox[{"ans", ",", "2", ",", 
              RowBox[{"preTrigSamples", "-", "1"}]}], " ", "]"}], " ", "-", 
            " ", 
            RowBox[{"(", 
             RowBox[{"-", "2.0"}], ")"}]}], "]"}], " ", "<", "eps"}], 
         ")"}]}]}], "]"}]}], ";"}], "                               ", 
   RowBox[{"(*", " ", 
    RowBox[{"one", " ", "sample", " ", "timing", " ", "error", " ", "OK"}], 
    " ", "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cond", " ", "=", " ", 
     RowBox[{"Append", "[", 
      RowBox[{"cond", ",", 
       RowBox[{
        RowBox[{"Abs", "[", 
         RowBox[{
          RowBox[{"Part", "[", 
           RowBox[{"ans", ",", "1", ",", 
            RowBox[{"preTrigSamples", " ", "+", " ", "1"}]}], "]"}], "-", " ",
           "1.0"}], " ", "]"}], " ", "<", " ", "eps"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cond", " ", "=", " ", 
     RowBox[{"Append", "[", 
      RowBox[{"cond", ",", 
       RowBox[{
        RowBox[{"Abs", "[", 
         RowBox[{
          RowBox[{"Part", "[", 
           RowBox[{"ans", ",", "2", ",", 
            RowBox[{"preTrigSamples", " ", "+", "1"}]}], " ", "]"}], " ", "-",
           " ", 
          RowBox[{"(", 
           RowBox[{"-", "1.0"}], ")"}]}], "]"}], " ", "<", "eps"}]}], "]"}]}],
     ";"}], "\[IndentingNewLine]", 
   RowBox[{"cond", ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", 
       RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1"}], "]"}], 
   "\[IndentingNewLine]", 
   RowBox[{"ListPlot", "[", 
    RowBox[{"ans", ",", " ", 
     RowBox[{"PlotJoined", "\[Rule]", "True"}]}], "]"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"LogTest`Assert", "[", 
     RowBox[{"And", "@@", "cond"}], "]"}], ";"}]}]}]], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706232703125*^9}, {
   3.447706283*^9, 3.447706302203125*^9}, {3.447706673828125*^9, 
   3.4477066945625*^9}, 3.447706780078125*^9, {3.447706830203125*^9, 
   3.447706834421875*^9}, {3.44776671221875*^9, 3.44776672759375*^9}, {
   3.447766784796875*^9, 3.447766819546875*^9}, {3.4477679*^9, 
   3.4477679250625*^9}, {3.447768184484375*^9, 3.447768518671875*^9}, {
   3.447768671359375*^9, 3.44776874496875*^9}, {3.447768779234375*^9, 
   3.447768911609375*^9}, {3.447769207734375*^9, 3.447769437703125*^9}, {
   3.447769503515625*^9, 3.447769812734375*^9}, {3.447769853453125*^9, 
   3.44776987903125*^9}, {3.447769916453125*^9, 3.447770087734375*^9}, {
   3.44777013534375*^9, 3.447770168546875*^9}, {3.447770225734375*^9, 
   3.447770295234375*^9}, {3.447770332890625*^9, 3.44777035215625*^9}, {
   3.447770754671875*^9, 3.4477707626875*^9}, {3.447771301125*^9, 
   3.4477713320625*^9}, {3.44777228946875*^9, 3.447772311515625*^9}, {
   3.447772913953125*^9, 3.44777292325*^9}, {3.4488137683125*^9, 
   3.448813800734375*^9}, {3.4488141613125*^9, 3.44881420225*^9}, {
   3.44881426115625*^9, 3.448814416734375*^9}, {3.51267667846875*^9, 
   3.51267673146875*^9}, {3.512676816140625*^9, 3.51267682328125*^9}, {
   3.512678058125*^9, 3.51267811284375*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Check trigger work on a higher number channel when specided out of order\
\>", "Subsubtitle",
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.447706907109375*^9}, {3.44770708628125*^9, 3.4477071205625*^9}, {
   3.4477703930625*^9, 3.447770410796875*^9}, {3.447770532765625*^9, 
   3.4477705414375*^9}, {3.44777179453125*^9, 3.447771844390625*^9}, {
   3.448214079046875*^9, 3.44821419434375*^9}}],

Cell["\<\
chech ability to trigger on second channel
Switching the order of channel works is this the inteneded solution?
trigChannel (forth parameter) does nothing
timing can be one sample off as channels acquired sequential I belive\
\>", "Text",
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.447706907109375*^9}, {3.44770708628125*^9, 3.4477071205625*^9}, {
   3.4477703930625*^9, 3.447770410796875*^9}, {3.447770532765625*^9, 
   3.4477705414375*^9}, {3.44777179453125*^9, 3.447771844390625*^9}, {
   3.448214079046875*^9, 3.448214082078125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<SoftwareTriggering multiple non sequential Channels with PreTrigger \
Samples\>\"", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", 
   RowBox[{"ans", ",", " ", "cond"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"numPts", "=", "500"}], ";", " ", 
  RowBox[{"fout", " ", "=", " ", "1000.0"}], ";", " ", 
  RowBox[{"Clear", "[", 
   RowBox[{"ans", ",", " ", "cond", ",", " ", "p1", ",", "p2"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"eps", " ", "=", 
   RowBox[{"1.0", " ", "*", " ", 
    SuperscriptBox["10", 
     RowBox[{"-", "2"}]]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"waveOut", " ", "=", " ", 
  RowBox[{"Transpose", "[", 
   RowBox[{"Join", "[", 
    RowBox[{
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0.0", ",", 
         RowBox[{"-", "2.0"}]}], "}"}], ",", 
       RowBox[{"{", "10", "}"}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"{", 
       RowBox[{"1.0", ",", 
        RowBox[{"-", "1.0"}]}], "}"}], "}"}], ",", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0.4", ",", 
         RowBox[{"-", "1.5"}]}], "}"}], ",", 
       RowBox[{"{", "10", "}"}]}], "]"}]}], "]"}], 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"th", " ", "=", " ", 
    RowBox[{"OutputWaveform", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"0", ",", "1"}], "}"}], ",", "waveOut", ",", " ", "fout", ",", 
      "1", ",", 
      RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
      RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
      RowBox[{"MessageLevel", " ", "\[Rule]", "0"}], ",", 
      RowBox[{"ActiveEdge", "\[Rule]", "Falling"}]}], "]"}]}], ";"}], 
  "\[IndentingNewLine]", "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ans", " ", "=", " ", 
   RowBox[{"GetVoltagesTrig", "[", 
    RowBox[{
     RowBox[{"channels", " ", "=", 
      RowBox[{"{", 
       RowBox[{"3", ",", "0"}], "}"}]}], ",", "10000.0", ",", 
     RowBox[{"postTriggerSamples", " ", "=", " ", "50"}], ",", 
     RowBox[{"trigChannel", " ", "=", " ", "0"}], ",", 
     RowBox[{"triggerLevel", "=", 
      RowBox[{"-", "1.2"}]}], ",", 
     RowBox[{"PreTriggerSamples", "\[Rule]", 
      RowBox[{"(", 
       RowBox[{"preTrigSamples", " ", "=", " ", "15"}], ")"}]}], ",", 
     RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
     RowBox[{"TransferMechanism", " ", "\[Rule]", "Interrupts"}], ",", " ", 
     RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", 
   RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"cond", " ", "=", 
    RowBox[{"Append", "[", 
     RowBox[{"cond", ",", 
      RowBox[{
       RowBox[{"Dimensions", "[", "ans", "]"}], "\[Equal]", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Length", "[", "channels", "]"}], ",", " ", 
         RowBox[{"postTriggerSamples", "+", "preTrigSamples"}]}], "}"}]}]}], 
     "]"}]}], ";"}], "  ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{
    "FIX", " ", "number", " ", "returned", " ", "not", " ", "current", " ", 
     "garenteed", " ", "to", " ", "be", " ", "pretrig"}], "+", 
    RowBox[{"postrigger", " ", "samples", " ", 
     RowBox[{"returned", " ", "--"}], " ", "check", " ", "pretrigsamples", 
     " ", "available", " ", "before", " ", "arming", " ", "trigger"}]}], 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"cond", " ", "=", " ", 
    RowBox[{"Append", "[", 
     RowBox[{"cond", ",", 
      RowBox[{
       RowBox[{"Abs", "[", 
        RowBox[{
         RowBox[{"Part", "[", 
          RowBox[{"ans", ",", "2", ",", 
           RowBox[{"preTrigSamples", "-", "1"}]}], "]"}], "-", " ", "0.0"}], 
        " ", "]"}], " ", "<", " ", "eps"}]}], "]"}]}], ";"}], "  ", 
  RowBox[{"(*", " ", 
   RowBox[{"channels", " ", "switched", " ", "in", " ", "GetVoltageTrig"}], 
   " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"cond", " ", "=", " ", 
    RowBox[{"Append", "[", 
     RowBox[{"cond", ",", 
      RowBox[{
       RowBox[{"Abs", "[", 
        RowBox[{
         RowBox[{"Part", "[", 
          RowBox[{"ans", ",", "1", ",", "preTrigSamples"}], "]"}], " ", "-", 
         " ", 
         RowBox[{"(", 
          RowBox[{"-", "2.0"}], ")"}]}], "]"}], " ", "<", "eps"}]}], "]"}]}], 
   ";"}], " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"cond", ",", 
     RowBox[{
      RowBox[{"Abs", "[", 
       RowBox[{
        RowBox[{"Part", "[", 
         RowBox[{"ans", ",", "2", ",", 
          RowBox[{"preTrigSamples", " ", "+", " ", "1"}]}], "]"}], "-", " ", 
        "1.0"}], " ", "]"}], " ", "<", " ", "eps"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"cond", ",", 
     RowBox[{
      RowBox[{"Abs", "[", 
       RowBox[{
        RowBox[{"Part", "[", 
         RowBox[{"ans", ",", "1", ",", 
          RowBox[{"preTrigSamples", " ", "+", "1"}]}], " ", "]"}], " ", "-", 
        " ", 
        RowBox[{"(", 
         RowBox[{"-", "1.0"}], ")"}]}], "]"}], " ", "<", "eps"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", "cond", "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", 
      RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"ListPlot", "[", 
  RowBox[{"ans", ",", " ", 
   RowBox[{"PlotJoined", "\[Rule]", "True"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{"And", "@@", "cond"}], "]"}], 
  ";"}], "\[IndentingNewLine]"}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.44770686328125*^9}, {3.447706916796875*^9, 3.44770693859375*^9}, {
   3.44770697046875*^9, 3.4477069725625*^9}, 3.44777043828125*^9, {
   3.4477704873125*^9, 3.44777052959375*^9}, {3.44777058128125*^9, 
   3.447770582484375*^9}, {3.447770625375*^9, 3.44777062759375*^9}, {
   3.4477707121875*^9, 3.447770716546875*^9}, {3.447770774296875*^9, 
   3.44777077684375*^9}, {3.44777080715625*^9, 3.447770910890625*^9}, {
   3.447771341546875*^9, 3.447771344015625*^9}, {3.447772327125*^9, 
   3.44777233309375*^9}, {3.4481206231875*^9, 3.448120638234375*^9}, {
   3.448816333265625*^9, 3.44881647528125*^9}, {3.448817043421875*^9, 
   3.448817064453125*^9}, 3.512676794125*^9, {3.512676833796875*^9, 
   3.5126768810625*^9}, {3.512925058921875*^9, 3.512925067828125*^9}, {
   3.517321443984375*^9, 3.5173214458125*^9}, {3.517321481515625*^9, 
   3.517321504703125*^9}, {3.51732161603125*^9, 3.517321617765625*^9}, {
   3.517321692828125*^9, 3.517321696140625*^9}, {3.517321870265625*^9, 
   3.51732189709375*^9}, {3.517321991765625*^9, 3.517321992078125*^9}, {
   3.5173221225*^9, 3.517322162265625*^9}, {3.517322324859375*^9, 
   3.517322325*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Triggering using Negative Slope", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.44770686328125*^9}, {3.447706916796875*^9, 3.44770693859375*^9}, {
   3.44770697046875*^9, 3.4477069725625*^9}, 3.44777043828125*^9, {
   3.4477704873125*^9, 3.44777052959375*^9}, {3.44777058128125*^9, 
   3.447770582484375*^9}, {3.447770625375*^9, 3.44777062759375*^9}, {
   3.4477707121875*^9, 3.447770716546875*^9}, {3.447770774296875*^9, 
   3.44777077684375*^9}, {3.44777080715625*^9, 3.447770910890625*^9}, {
   3.447771341546875*^9, 3.447771344015625*^9}, {3.447772327125*^9, 
   3.44777233309375*^9}, {3.4481206231875*^9, 3.448120664453125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", "\"\<Testing GetVoltagesTrig Negative Slope\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"numPts", "=", "100"}], ";", " ", 
   RowBox[{"fout", " ", "=", " ", "10000.0"}], ";"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "p1", "]"}], ";", 
  RowBox[{"Clear", "[", "p2", "]"}], ";", 
  RowBox[{"data2", "=", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"data", " ", "=", " ", 
   RowBox[{"Transpose", "[", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Sin", "[", "x", "]"}], ",", 
         RowBox[{"Cos", "[", "x", "]"}]}], "}"}], "//", "N"}], ",", 
      RowBox[{"{", 
       RowBox[{"x", ",", "0", ",", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{"2", "*", " ", "Pi"}], ")"}], "*", 
         RowBox[{"(", 
          RowBox[{"1", "-", 
           RowBox[{"1", "/", "numPts"}]}], ")"}]}], ",", 
        RowBox[{"2", "*", 
         RowBox[{"Pi", "/", "numPts"}]}]}], "}"}]}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"th", " ", "=", " ", 
    RowBox[{"OutputWaveform", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"0", ",", "1"}], "}"}], ",", "data", ",", " ", "fout", ",", 
      "1", ",", 
      RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
      RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
      RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], ";"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"data2", " ", "=", " ", 
     RowBox[{"GetVoltages", "[", 
      RowBox[{
       RowBox[{"{", "0", "}"}], ",", "10000.0", ",", "2000", ",", 
       RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
       RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "Interrupts"}]}], 
      "]"}]}], ";"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"cond", " ", "=", 
   RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Table", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"(", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"data2", " ", "=", " ", 
       RowBox[{"GetVoltagesTrig", "[", 
        RowBox[{
         RowBox[{"{", "0", "}"}], ",", "50000.0", ",", "500", ",", "0", ",", 
         "triggerLevel", ",", 
         RowBox[{"TriggerSlope", "\[Rule]", "Falling"}], ",", " ", 
         RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
         RowBox[{"TransferMechanism", " ", "\[Rule]", "Interrupts"}]}], 
        "]"}]}], ";", "\[IndentingNewLine]", " ", 
      RowBox[{"Print", "[", " ", 
       RowBox[{"triggerLevel", ",", "\"\< --> \>\"", ",", " ", 
        RowBox[{
         RowBox[{"data2", "[", 
          RowBox[{"[", "1", "]"}], "]"}], "[", 
         RowBox[{"[", "2", "]"}], "]"}]}], "]"}], " ", ";", 
      "\[IndentingNewLine]", 
      RowBox[{"p1", " ", "=", " ", 
       RowBox[{"ListPlot", "[", "data2", "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"cond", " ", "=", " ", 
       RowBox[{"Append", "[", 
        RowBox[{"cond", ",", 
         RowBox[{
          RowBox[{
           RowBox[{
            RowBox[{"data2", "[", 
             RowBox[{"[", "1", "]"}], "]"}], "[", 
            RowBox[{"[", "2", "]"}], "]"}], " ", "-", " ", "triggerLevel"}], 
          " ", "<=", "0"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"cond", " ", "=", " ", 
       RowBox[{"Append", "[", 
        RowBox[{"cond", ",", " ", 
         RowBox[{
          RowBox[{
           RowBox[{
            RowBox[{"data2", "[", 
             RowBox[{"[", "1", "]"}], "]"}], "[", 
            RowBox[{"[", "2", "]"}], "]"}], " ", "-", " ", "triggerLevel"}], 
          " ", "\[LessEqual]", " ", 
          RowBox[{
           RowBox[{"(", " ", 
            RowBox[{
             RowBox[{
              RowBox[{"data", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "[", 
              RowBox[{"[", "2", "]"}], "]"}], "-", " ", 
             RowBox[{
              RowBox[{"data", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "[", 
              RowBox[{"[", "1", "]"}], "]"}]}], ")"}], "*", "1.5"}]}]}], 
        "]"}]}], ";"}], "\[IndentingNewLine]", ")"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{"triggerLevel", ",", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"-", ".2"}], ",", "0.2", ",", ".5"}], "}"}]}], "}"}]}], "]"}],
   ";"}], "\[IndentingNewLine]", "cond", "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p2", " ", "=", 
   RowBox[{"ListPlot", "[", 
    RowBox[{
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"i", "/", "fout"}], ",", 
         RowBox[{
          RowBox[{"data", "[", 
           RowBox[{"[", "1", "]"}], "]"}], "[", 
          RowBox[{"[", "i", "]"}], "]"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", "1", ",", 
         RowBox[{"numPts", "-", "1"}]}], "}"}]}], "]"}], ",", 
     RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Show", "[", 
  RowBox[{"p1", ",", "p2"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LogTest`Assert", "[", 
   RowBox[{"And", " ", "@@", " ", "cond"}], "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.44770686328125*^9}, {3.447706916796875*^9, 3.44770693859375*^9}, {
   3.44770697046875*^9, 3.4477069725625*^9}, 3.44777043828125*^9, {
   3.4477704873125*^9, 3.44777052959375*^9}, {3.44777058128125*^9, 
   3.447770582484375*^9}, {3.447770625375*^9, 3.44777062759375*^9}, {
   3.4477707121875*^9, 3.447770716546875*^9}, {3.447770774296875*^9, 
   3.44777077684375*^9}, {3.44777080715625*^9, 3.447770910890625*^9}, {
   3.447771341546875*^9, 3.447771344015625*^9}, {3.447772327125*^9, 
   3.44777233309375*^9}, {3.4481206231875*^9, 3.448120634015625*^9}, {
   3.44812066790625*^9, 3.448120673390625*^9}, {3.44812073078125*^9, 
   3.448120801734375*^9}, {3.448120849515625*^9, 3.44812084996875*^9}, {
   3.4481351950957355`*^9, 3.4481352062519855`*^9}, {3.44821422759375*^9, 
   3.44821422775*^9}, {3.448913369421875*^9, 3.448913377234375*^9}, {
   3.5126772045625*^9, 3.51267730409375*^9}, {3.5126785553125*^9, 
   3.5126785555625*^9}, {3.51268105834375*^9, 3.5126810585*^9}, {
   3.512681181609375*^9, 3.51268119621875*^9}, {3.51732288215625*^9, 
   3.517322913078125*^9}, {3.517322957234375*^9, 3.517322985875*^9}, {
   3.5173230515625*^9, 3.51732305190625*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Check that number of samples returned is always pretriggersamples + \
postrigger samples\
\>", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.44770686328125*^9}, {3.447706916796875*^9, 3.44770693859375*^9}, {
   3.44770697046875*^9, 3.4477069725625*^9}, 3.44777043828125*^9, {
   3.4477704873125*^9, 3.44777052959375*^9}, {3.44777058128125*^9, 
   3.447770582484375*^9}, {3.447770625375*^9, 3.44777062759375*^9}, {
   3.4477707121875*^9, 3.447770716546875*^9}, {3.447770774296875*^9, 
   3.44777077684375*^9}, {3.44777080715625*^9, 3.447770910890625*^9}, {
   3.447771341546875*^9, 3.447771344015625*^9}, {3.447772327125*^9, 
   3.44777233309375*^9}, {3.4481206231875*^9, 3.448120634015625*^9}, {
   3.44812066790625*^9, 3.448120673390625*^9}, {3.44812073078125*^9, 
   3.448120801734375*^9}, {3.448120849515625*^9, 3.44812084996875*^9}, {
   3.4481351950957355`*^9, 3.4481352062519855`*^9}, {3.44821422759375*^9, 
   3.44821422775*^9}, {3.448913369421875*^9, 3.44891348196875*^9}}],

Cell["\<\
Current both OutputWavefom and GetVoltagesTrig need to use DMA.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.44770686328125*^9}, {3.447706916796875*^9, 3.44770693859375*^9}, {
   3.44770697046875*^9, 3.4477069725625*^9}, 3.44777043828125*^9, {
   3.4477704873125*^9, 3.44777052959375*^9}, {3.44777058128125*^9, 
   3.447770582484375*^9}, {3.447770625375*^9, 3.44777062759375*^9}, {
   3.4477707121875*^9, 3.447770716546875*^9}, {3.447770774296875*^9, 
   3.44777077684375*^9}, {3.44777080715625*^9, 3.447770910890625*^9}, {
   3.447771341546875*^9, 3.447771344015625*^9}, {3.447772327125*^9, 
   3.44777233309375*^9}, {3.4481206231875*^9, 3.448120634015625*^9}, {
   3.44812066790625*^9, 3.448120673390625*^9}, {3.44812073078125*^9, 
   3.448120801734375*^9}, {3.448120849515625*^9, 3.44812084996875*^9}, {
   3.4481351950957355`*^9, 3.4481352062519855`*^9}, {3.44821422759375*^9, 
   3.44821422775*^9}, {3.448913369421875*^9, 3.448913402*^9}, {
   3.448913627171875*^9, 3.44891366759375*^9}, {3.448913791734375*^9, 
   3.448913890421875*^9}, {3.448913967765625*^9, 3.448913976859375*^9}, {
   3.44891464621875*^9, 3.44891471725*^9}, 3.44891620984375*^9, {
   3.448916316671875*^9, 3.448916329796875*^9}, {3.44891645690625*^9, 
   3.448916482765625*^9}, {3.448916531953125*^9, 3.44891661296875*^9}, {
   3.448981347125*^9, 3.448981433890625*^9}, {3.4489815203125*^9, 
   3.4489815495*^9}, {3.448983057328125*^9, 3.4489830584375*^9}, {
   3.448983159984375*^9, 3.448983179421875*^9}, {3.448983210046875*^9, 
   3.44898345225*^9}, 3.448983482515625*^9, {3.44898351740625*^9, 
   3.44898354971875*^9}, {3.44898362359375*^9, 3.448983739328125*^9}, {
   3.448983820625*^9, 3.448983909265625*^9}, 3.44898405796875*^9, {
   3.44924703196875*^9, 3.449247098703125*^9}, {3.4492471536875*^9, 
   3.449247256015625*^9}, {3.5126773556875*^9, 3.5126774675625*^9}, {
   3.512677580359375*^9, 3.512677582359375*^9}, {3.512677654984375*^9, 
   3.512677690296875*^9}, {3.512678215640625*^9, 3.51267827746875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"runSampleNumberCheck", "[", "fout_Real", "]"}], " ", ":=", 
   "\[IndentingNewLine]", 
   RowBox[{"(", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"numPts", "=", "500"}], ";", " ", 
     RowBox[{"Clear", "[", 
      RowBox[{"ans", ",", " ", "cond", ",", " ", "p1", ",", "p2"}], "]"}], 
     ";", "\[IndentingNewLine]", 
     RowBox[{"eps", " ", "=", 
      RowBox[{"1.0", " ", "*", " ", 
       SuperscriptBox["10", 
        RowBox[{"-", "2"}]]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"waveOut", " ", "=", " ", 
      RowBox[{"Join", "[", 
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{"0.", ",", 
          RowBox[{"{", "10", "}"}]}], "]"}], ",", 
        RowBox[{"Table", "[", 
         RowBox[{"5.0", ",", 
          RowBox[{"{", "10", "}"}]}], "]"}]}], "]"}]}], ";", "\n", 
     RowBox[{"th", " ", "=", " ", 
      RowBox[{"OutputWaveform", "[", 
       RowBox[{
        RowBox[{"{", "0", "}"}], ",", "waveOut", ",", " ", "fout", ",", "1", 
        ",", 
        RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
        RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}], ",", 
        RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"ans", " ", "=", " ", 
      RowBox[{"GetVoltagesTrig", "[", 
       RowBox[{
        RowBox[{"channels", " ", "=", 
         RowBox[{"{", "0", "}"}]}], ",", "10000.0", ",", 
        RowBox[{"postTrigSamples", " ", "=", " ", "50"}], ",", "0", ",", 
        RowBox[{"triggerLevel", "=", "1.5"}], ",", 
        RowBox[{"PreTriggerSamples", "\[Rule]", 
         RowBox[{"(", 
          RowBox[{"preTrigSamples", " ", "=", " ", "100"}], ")"}]}], ",", 
        RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
        RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}], ",", " ", 
        RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"Length", "[", "ans", "]"}], ",", " ", "preTrigSamples", ",", 
       "postTrigSamples"}], "}"}], ";", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Length", "[", "ans", "]"}], " ", "\[Equal]", " ", 
      RowBox[{"preTrigSamples", "+", "postTrigSamples"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"cond", "=", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"Length", "[", "ans", "]"}], " ", "\[Equal]", " ", 
        RowBox[{"preTrigSamples", "+", "postTrigSamples"}]}], "}"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"And", "@@", "cond"}], ";", "\[IndentingNewLine]", 
     RowBox[{"ClearTask", "[", "th", "]"}], ";", "\[IndentingNewLine]", 
     RowBox[{"OutputWaveform", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"0", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", "0", "}"}], ",", 
         RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1"}], "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"And", "@@", "cond"}]}], "\[IndentingNewLine]", ")"}]}], 
  "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "Number", " ", "of", " ", "samples", " ", "taken", " ", "spans", " ", 
    "more", " ", "than", " ", "a", " ", "period", " ", "of", " ", "the", " ", 
    "input", " ", 
    RowBox[{"signal", "."}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Sample number equals pretrigger + posttrigger for multiple cycles of \
input\>\"", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"sampleConditions", " ", "=", " ", 
   RowBox[{"runSampleNumberCheck", "[", "10000.0", "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"ListPlot", "[", 
  RowBox[{"ans", ",", " ", 
   RowBox[{"PlotJoined", "\[Rule]", "True"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Assert", "[", 
    RowBox[{"And", "@@", "sampleConditions"}], "]"}], ";"}], 
  "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "The", " ", "sample", " ", "interval", " ", "is", " ", "small", " ", 
    "compared", " ", "to", " ", "the", " ", "input", " ", "signal", " ", 
    "period"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", 
   "\"\<Sample number equals pretrigger + posttrigger for slow input signal\>\
\"", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"sampleConditions", " ", "=", " ", 
  RowBox[{
  "runSampleNumberCheck", "[", "100.0", "]"}]}], "\[IndentingNewLine]", 
 RowBox[{"ListPlot", "[", 
  RowBox[{"ans", ",", " ", 
   RowBox[{"PlotJoined", "\[Rule]", "True"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"ans", ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LogTest`Assert", "[", " ", 
    RowBox[{"And", "@@", "sampleConditions"}], "]"}], ";"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"(*", " ", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
     "A", " ", "very", " ", "slow", " ", "test", " ", "disabled", " ", "by", 
      " ", 
      RowBox[{"default", "!!"}], "\[IndentingNewLine]", "sampleConditions"}], 
     " ", "=", " ", 
     RowBox[{
      RowBox[{"runSampleNumberCheck", "[", "0.10", "]"}], 
      "\[IndentingNewLine]", 
      RowBox[{"LogTest`Test", "[", 
       RowBox[{
       "\"\<Sample number equals pretrigger + posttrigger for slow input \
signal\>\"", ",", " ", 
        RowBox[{"And", "@@", "sampleConditions"}]}], "]"}]}]}], ";", 
    "\[IndentingNewLine]", 
    RowBox[{"ListPlot", "[", 
     RowBox[{"ans", ",", " ", 
      RowBox[{"PlotJoined", "\[Rule]", "True"}]}], "]"}]}], 
   "\[IndentingNewLine]", "*)"}]}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.44761098271875*^9, 3.44761098515625*^9}, {
   3.447611209203125*^9, 3.447611246296875*^9}, {3.44770503690625*^9, 
   3.447705044171875*^9}, {3.447705106359375*^9, 3.447705122390625*^9}, {
   3.4477051551875*^9, 3.447705173734375*^9}, {3.44770521759375*^9, 
   3.44770523059375*^9}, {3.447705384953125*^9, 3.44770539421875*^9}, 
   3.447705639984375*^9, {3.447705681234375*^9, 3.447705681390625*^9}, {
   3.44770574384375*^9, 3.44770574921875*^9}, {3.44770583584375*^9, 
   3.447705855296875*^9}, {3.44770588796875*^9, 3.447705901609375*^9}, {
   3.447705986390625*^9, 3.44770599496875*^9}, {3.447706120609375*^9, 
   3.44770613421875*^9}, {3.4477062279375*^9, 3.447706258828125*^9}, {
   3.447706322328125*^9, 3.447706376078125*^9}, 3.447706442015625*^9, {
   3.447706476046875*^9, 3.44770659071875*^9}, {3.447706820171875*^9, 
   3.44770686328125*^9}, {3.447706916796875*^9, 3.44770693859375*^9}, {
   3.44770697046875*^9, 3.4477069725625*^9}, 3.44777043828125*^9, {
   3.4477704873125*^9, 3.44777052959375*^9}, {3.44777058128125*^9, 
   3.447770582484375*^9}, {3.447770625375*^9, 3.44777062759375*^9}, {
   3.4477707121875*^9, 3.447770716546875*^9}, {3.447770774296875*^9, 
   3.44777077684375*^9}, {3.44777080715625*^9, 3.447770910890625*^9}, {
   3.447771341546875*^9, 3.447771344015625*^9}, {3.447772327125*^9, 
   3.44777233309375*^9}, {3.4481206231875*^9, 3.448120634015625*^9}, {
   3.44812066790625*^9, 3.448120673390625*^9}, {3.44812073078125*^9, 
   3.448120801734375*^9}, {3.448120849515625*^9, 3.44812084996875*^9}, {
   3.4481351950957355`*^9, 3.4481352062519855`*^9}, {3.44821422759375*^9, 
   3.44821422775*^9}, {3.448913369421875*^9, 3.448913402*^9}, {
   3.448913627171875*^9, 3.44891366759375*^9}, {3.448913791734375*^9, 
   3.448913890421875*^9}, {3.448913967765625*^9, 3.448913976859375*^9}, {
   3.44891464621875*^9, 3.44891471725*^9}, 3.44891620984375*^9, {
   3.448916316671875*^9, 3.448916329796875*^9}, {3.44891645690625*^9, 
   3.448916482765625*^9}, {3.448916531953125*^9, 3.44891661296875*^9}, {
   3.448981347125*^9, 3.448981433890625*^9}, {3.4489815203125*^9, 
   3.4489815495*^9}, {3.448983057328125*^9, 3.4489830584375*^9}, {
   3.448983159984375*^9, 3.448983179421875*^9}, {3.448983210046875*^9, 
   3.44898345225*^9}, 3.448983482515625*^9, {3.44898351740625*^9, 
   3.44898354971875*^9}, {3.44898362359375*^9, 3.448983739328125*^9}, {
   3.448983820625*^9, 3.448983909265625*^9}, 3.44898405796875*^9, {
   3.44924703196875*^9, 3.449247098703125*^9}, {3.4492471536875*^9, 
   3.449247256015625*^9}, {3.5126773556875*^9, 3.5126774675625*^9}, {
   3.512677580359375*^9, 3.512677582359375*^9}, {3.512677654984375*^9, 
   3.512677690296875*^9}, {3.512678215640625*^9, 3.512678266671875*^9}, {
   3.512681814140625*^9, 3.512681816171875*^9}, {3.51268186740625*^9, 
   3.512681869734375*^9}, {3.512682052703125*^9, 3.5126820635*^9}, {
   3.51269893121875*^9, 3.51269897765625*^9}, {3.512699714015625*^9, 
   3.512699715453125*^9}, 3.51292466553125*^9, {3.517259063120125*^9, 
   3.517259080651375*^9}}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Hardware Triggering on Digital Input", "Subtitle",
 CellChangeTimes->{{3.449279887566244*^9, 3.449280062081869*^9}, {
  3.449280130691244*^9, 3.449280153066244*^9}, {3.512681598015625*^9, 
  3.51268160684375*^9}, {3.512681676*^9, 3.51268170996875*^9}}],

Cell[TextData[{
 "The problem with digital triggering is it returns an list from the c pp \
function call where software triggering returns a list of two lists \
{{pretrigger samples}, {posttriger samples}} the function to look at in \
DataAcquistion.nb is gettrigcompletelist[]\nI think I like the {{pretrigger \
samples}, {posttriger samples}}returnbecause user can alway combine using ",
 StyleBox["Flatten[data,1]",
  FontFamily->"Times New Roman",
  FontWeight->"Bold"],
 StyleBox["\n",
  FontFamily->"Times New Roman",
  FontSize->14,
  FontWeight->"Bold"],
 StyleBox["Digital tirgigering returns one sample before trigger event\n\
Analog triggering is slow for some cases.\ndigital trigger always returns 2 \
pretrrgger samples\nany text value accepted in Options maybe use set?",
  FontFamily->"Times New Roman"]
}], "Text",
 CellChangeTimes->{{3.449279887566244*^9, 3.449280062081869*^9}, {
   3.449280130691244*^9, 3.449280153066244*^9}, {3.512681598015625*^9, 
   3.51268163528125*^9}, {3.51269413053125*^9, 3.512694178265625*^9}, 
   3.51269446059375*^9, {3.512699262484375*^9, 3.51269927309375*^9}, {
   3.51269995675*^9, 3.512699998578125*^9}, {3.51274090046875*^9, 
   3.512740952875*^9}, {3.512874044375*^9, 3.512874069109375*^9}, {
   3.513089461359375*^9, 3.51308948621875*^9}, {3.513181633359375*^9, 
   3.513181664109375*^9}}],

Cell[CellGroupData[{

Cell["Digital Triggering One Channel", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4493489495064793`*^9, 3.4493489498346043`*^9}, {
   3.4493490471471043`*^9, 3.4493490473658543`*^9}, {3.512695043328125*^9, 
   3.512695072578125*^9}, {3.512695133015625*^9, 3.5126951615*^9}, {
   3.51269522790625*^9, 3.5126952293125*^9}, {3.51269528365625*^9, 
   3.5126953570625*^9}, {3.51269547259375*^9, 3.512695473203125*^9}, {
   3.512695587453125*^9, 3.512695666546875*^9}, {3.512696871703125*^9, 
   3.51269691903125*^9}, 3.512697098125*^9, {3.5126971834375*^9, 
   3.512697246875*^9}, {3.512697596890625*^9, 3.512697629015625*^9}, {
   3.512697708796875*^9, 3.512697714015625*^9}, {3.512697814453125*^9, 
   3.512697848421875*^9}, {3.5126980044375*^9, 3.51269800734375*^9}, {
   3.51269804240625*^9, 3.51269804453125*^9}, {3.5126981378125*^9, 
   3.51269815875*^9}, {3.512698268328125*^9, 3.51269831946875*^9}, {
   3.512698353859375*^9, 3.51269838828125*^9}, {3.51269855046875*^9, 
   3.5126985670625*^9}, {3.5126986135625*^9, 3.51269861590625*^9}, {
   3.51269876228125*^9, 3.512698774203125*^9}, {3.51269886853125*^9, 
   3.51269887409375*^9}, {3.512699050859375*^9, 3.512699064640625*^9}, {
   3.512699214359375*^9, 3.51269923825*^9}, 3.512699344234375*^9, {
   3.512699386078125*^9, 3.51269941790625*^9}, {3.51269948534375*^9, 
   3.512699513796875*^9}, {3.512699550953125*^9, 3.512699551078125*^9}, 
   3.51270001159375*^9, {3.51270004721875*^9, 3.512700072421875*^9}, {
   3.512700138671875*^9, 3.512700198546875*^9}, {3.51270094578125*^9, 
   3.51270094596875*^9}, {3.512701015328125*^9, 3.512701015421875*^9}, {
   3.51273856915625*^9, 3.512738596109375*^9}, {3.5127397274375*^9, 
   3.512739750890625*^9}, 3.51273980725*^9, {3.512740170578125*^9, 
   3.51274019240625*^9}, {3.5127405374375*^9, 3.5127405470625*^9}, {
   3.512740595640625*^9, 3.512740603453125*^9}, {3.512740652515625*^9, 
   3.51274067990625*^9}, {3.512740980046875*^9, 3.512740980203125*^9}, {
   3.512741180015625*^9, 3.5127411963125*^9}, {3.512741239546875*^9, 
   3.512741283859375*^9}, {3.512741348703125*^9, 3.5127413948125*^9}, {
   3.512741701859375*^9, 3.51274183378125*^9}, {3.5127418746875*^9, 
   3.51274200209375*^9}, {3.5127420515*^9, 3.51274205875*^9}, {
   3.5127421648125*^9, 3.512742165203125*^9}, 3.512873622265625*^9, {
   3.5128736755*^9, 3.5128736756875*^9}, {3.512873723140625*^9, 
   3.51287374965625*^9}, {3.51287380728125*^9, 3.51287391503125*^9}, 
   3.512873985265625*^9, {3.51292132996875*^9, 3.51292133025*^9}, {
   3.51292144075*^9, 3.512921441015625*^9}, {3.5129222058125*^9, 
   3.512922258765625*^9}, {3.512922651375*^9, 3.512922670109375*^9}, {
   3.512922713234375*^9, 3.512922814328125*^9}, {3.51292285453125*^9, 
   3.512923001328125*^9}, {3.51292304475*^9, 3.512923045625*^9}, {
   3.5129231749375*^9, 3.51292321303125*^9}, {3.512923336234375*^9, 
   3.512923372265625*^9}, {3.51292342678125*^9, 3.512923543546875*^9}, {
   3.512923594265625*^9, 3.51292360396875*^9}, {3.51292469615625*^9, 
   3.512924707625*^9}, {3.512924764671875*^9, 3.512924766125*^9}, 
   3.512924810953125*^9, {3.51292484871875*^9, 3.5129248574375*^9}, {
   3.512924906828125*^9, 3.51292492275*^9}, {3.51292509146875*^9, 
   3.512925179875*^9}, {3.512925224890625*^9, 3.512925269015625*^9}, {
   3.512925303515625*^9, 3.512925377*^9}, {3.512925417328125*^9, 
   3.51292545165625*^9}, 3.51292549996875*^9, {3.5129255945*^9, 
   3.5129255970625*^9}, 3.51292563334375*^9, {3.512925692515625*^9, 
   3.5129256926875*^9}, {3.512925740828125*^9, 3.51292576428125*^9}, {
   3.512925806515625*^9, 3.512925835609375*^9}, {3.512925872328125*^9, 
   3.51292590278125*^9}, {3.51292595840625*^9, 3.512925962203125*^9}, {
   3.512926278046875*^9, 3.512926369125*^9}, {3.512929375984375*^9, 
   3.512929444421875*^9}, {3.51292949184375*^9, 3.512929509515625*^9}, {
   3.512929545890625*^9, 3.512929570578125*^9}, {3.512930786140625*^9, 
   3.512930794703125*^9}, {3.512931033796875*^9, 3.512931072890625*^9}, {
   3.5129311425625*^9, 3.512931157609375*^9}, {3.512939377765625*^9, 
   3.51293945046875*^9}, {3.51293951075*^9, 3.512939535921875*^9}, {
   3.51293956915625*^9, 3.512939573328125*^9}, {3.512939777390625*^9, 
   3.512939837203125*^9}, {3.512939898609375*^9, 3.51293997825*^9}, {
   3.512940049328125*^9, 3.512940058671875*^9}, 3.513089235953125*^9, {
   3.51308926825*^9, 3.513089295625*^9}, {3.513089366015625*^9, 
   3.513089366359375*^9}, 3.51308944815625*^9, {3.513089503859375*^9, 
   3.513089519796875*^9}, {3.513089621375*^9, 3.51308962153125*^9}, {
   3.513091138953125*^9, 3.513091168703125*^9}, {3.513091206609375*^9, 
   3.513091207140625*^9}, {3.513091421984375*^9, 3.5130914225*^9}, {
   3.5130916931875*^9, 3.513091723375*^9}, {3.513093005234375*^9, 
   3.513093015421875*^9}, {3.513094833203125*^9, 3.513094833421875*^9}, {
   3.51309496834375*^9, 3.51309496903125*^9}, {3.513096004578125*^9, 
   3.513096012046875*^9}, {3.513096070328125*^9, 3.513096070671875*^9}, {
   3.51309615634375*^9, 3.513096180265625*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", "\"\<Digital triggering one channel\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{" ", 
  RowBox[{
   RowBox[{"Clear", "[", 
    RowBox[{
    "ansDigital", ",", "ansAnalog", ",", " ", "conds", ",", " ", "plots", ",",
      "plotDigital", ",", "plotAnalog"}], "]"}], 
   ";"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"numPts", "=", "100"}], ";", " ", 
  RowBox[{"fout", " ", "=", " ", "1000.0"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"fin", " ", "=", "1000.0"}], ";", 
  RowBox[{"preTrigSamples", " ", "=", " ", "10"}], ";", 
  RowBox[{"postTriggerSamples", " ", "=", " ", "30"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"commonOpts", " ", "=", " ", 
    RowBox[{"Sequence", "[", 
     RowBox[{
      RowBox[{"SampleMode", " ", "\[Rule]", " ", "Finite"}], ",", " ", 
      RowBox[{"PreTriggerSamples", "\[Rule]", "preTrigSamples"}], ",", 
      RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
      RowBox[{"TransferMechanism", " ", "\[Rule]", "Interrupts"}], ",", 
      RowBox[{"TriggerSlope", "\[Rule]", "Rising"}], ",", 
      RowBox[{"IncludeTime", "\[Rule]", "Omit"}]}], "]"}]}], ";"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p1", " ", "=", " ", 
   RowBox[{"ListPlot", "[", 
    RowBox[{
     RowBox[{"waveOut", " ", "=", " ", 
      RowBox[{"Transpose", "[", 
       RowBox[{"Join", "[", 
        RowBox[{
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"-", "1"}], ",", "4.0"}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"numPts", "/", "2"}], "}"}]}], "]"}], ",", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"5.5", ",", 
             RowBox[{"-", "1.0"}]}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"numPts", "/", "2"}], "}"}]}], "]"}]}], "]"}], "]"}]}], 
     ",", 
     RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t1", "=", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"th", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", "waveOut", ",", " ", "fout", ",", 
     "1", ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
     RowBox[{"TransferMechanism", " ", "\[Rule]", " ", "DMA"}], ",", 
     RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{"\"\<OutputWaveform took: \>\"", ",", " ", 
    RowBox[{
     RowBox[{"AbsoluteTime", "[", "]"}], "-", "t1"}], ",", " ", 
    "\"\< seconds\>\""}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"plots", "=", 
   RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"conds", " ", "=", 
    RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]",
   "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "first", " ", "test", " ", "trigger", " ", "on", " ", "signal", " ", 
    "that", " ", "you", " ", "are", " ", "recording"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t1", "=", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ansDigital", " ", "=", " ", 
   RowBox[{"GetVoltagesDigTrig", "[", 
    RowBox[{
     RowBox[{"channels", " ", "=", 
      RowBox[{"{", "0", "}"}]}], ",", "fin", ",", "postTriggerSamples", ",", 
     RowBox[{"trigChannel", " ", "=", " ", "0"}], ",", "commonOpts"}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{"\"\<Digital triggering took: \>\"", ",", " ", 
    RowBox[{
     RowBox[{"AbsoluteTime", "[", "]"}], "-", "t1"}], ",", " ", 
    "\"\< seconds\>\""}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"conds", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"conds", ",", 
     RowBox[{
      RowBox[{"ansDigital", "[", 
       RowBox[{"[", "preTrigSamples", "]"}], "]"}], " ", "<", " ", "2.5", " ",
       "<", " ", 
      RowBox[{"ansDigital", "[", 
       RowBox[{"[", 
        RowBox[{"preTrigSamples", " ", "+", "1"}], "]"}], "]"}]}]}], " ", 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"plots", "=", " ", 
    RowBox[{"Append", "[", 
     RowBox[{"plots", ",", " ", 
      RowBox[{"ListPlot", "[", 
       RowBox[{"ansDigital", ",", 
        RowBox[{"PlotRange", " ", "\[Rule]", " ", "All"}]}], "]"}]}], "]"}]}],
    ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "Software", " ", "triggering", " ", "takes", " ", "too", " ", "long", " ", 
    "at", " ", "slow", " ", "speeds", " ", "suspect", " ", "finite", " ", 
    "number", " ", "in", " ", "testing", " ", "array", " ", "must", " ", "be",
     " ", "read", " ", "before", " ", "returning"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t1", "=", 
   RowBox[{"AbsoluteTime", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ansAnalog", "=", " ", 
   RowBox[{"GetVoltagesTrig", "[", 
    RowBox[{
     RowBox[{"channels", " ", "=", 
      RowBox[{"{", "0", "}"}]}], ",", "fin", ",", "postTriggerSamples", ",", 
     RowBox[{"trigChannel", " ", "=", " ", "0"}], ",", 
     RowBox[{"triggerLevel", "=", "2.0"}], ",", "commonOpts"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{"\"\<Software triggering took: \>\"", ",", " ", 
    RowBox[{
     RowBox[{"AbsoluteTime", "[", "]"}], "-", "t1"}], ",", " ", 
    "\"\< seconds\>\""}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{" ", 
  RowBox[{
   RowBox[{"conds", " ", "=", " ", 
    RowBox[{"Append", "[", 
     RowBox[{"conds", ",", " ", 
      RowBox[{
       RowBox[{"ansAnalog", "[", 
        RowBox[{"[", "preTrigSamples", "]"}], "]"}], " ", "<", " ", 
       "triggerLevel", " ", "<", " ", 
       RowBox[{"ansAnalog", "[", 
        RowBox[{"[", 
         RowBox[{"preTrigSamples", "+", "1"}], "]"}], "]"}]}]}], " ", "]"}]}],
    ";"}], " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"plots", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"plots", ",", 
     RowBox[{"ListPlot", "[", 
      RowBox[{"ansAnalog", ",", 
       RowBox[{"PlotRange", " ", "\[Rule]", " ", "All"}], ",", " ", 
       RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"conds", ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Show", "[", 
   RowBox[{"plots", ",", 
    RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", 
      RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{"And", "@@", "conds"}], "]"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4493489495064793`*^9, 3.4493489498346043`*^9}, {
   3.4493490471471043`*^9, 3.4493490473658543`*^9}, {3.512695043328125*^9, 
   3.512695072578125*^9}, {3.512695133015625*^9, 3.5126951615*^9}, {
   3.51269522790625*^9, 3.5126952293125*^9}, {3.51269528365625*^9, 
   3.5126953570625*^9}, {3.51269547259375*^9, 3.512695473203125*^9}, {
   3.512695587453125*^9, 3.512695666546875*^9}, {3.512696871703125*^9, 
   3.51269691903125*^9}, 3.512697098125*^9, {3.5126971834375*^9, 
   3.512697246875*^9}, {3.512697596890625*^9, 3.512697629015625*^9}, {
   3.512697708796875*^9, 3.512697714015625*^9}, {3.512697814453125*^9, 
   3.512697848421875*^9}, {3.5126980044375*^9, 3.51269800734375*^9}, {
   3.51269804240625*^9, 3.51269804453125*^9}, {3.5126981378125*^9, 
   3.51269815875*^9}, {3.512698268328125*^9, 3.51269831946875*^9}, {
   3.512698353859375*^9, 3.51269838828125*^9}, {3.51269855046875*^9, 
   3.5126985670625*^9}, {3.5126986135625*^9, 3.51269861590625*^9}, {
   3.51269876228125*^9, 3.512698774203125*^9}, {3.51269886853125*^9, 
   3.51269887409375*^9}, {3.512699050859375*^9, 3.512699064640625*^9}, {
   3.512699214359375*^9, 3.51269923825*^9}, 3.512699344234375*^9, {
   3.512699386078125*^9, 3.51269941790625*^9}, {3.51269948534375*^9, 
   3.512699513796875*^9}, {3.512699550953125*^9, 3.512699551078125*^9}, 
   3.51270001159375*^9, {3.51270004721875*^9, 3.512700072421875*^9}, {
   3.512700138671875*^9, 3.512700198546875*^9}, {3.51270094578125*^9, 
   3.51270094596875*^9}, {3.512701015328125*^9, 3.512701015421875*^9}, {
   3.51273856915625*^9, 3.512738596109375*^9}, {3.5127397274375*^9, 
   3.512739750890625*^9}, 3.51273980725*^9, {3.512740170578125*^9, 
   3.51274019240625*^9}, {3.5127405374375*^9, 3.5127405470625*^9}, {
   3.512740595640625*^9, 3.512740603453125*^9}, {3.512740652515625*^9, 
   3.51274067990625*^9}, {3.512740980046875*^9, 3.512740980203125*^9}, {
   3.512741180015625*^9, 3.5127411963125*^9}, {3.512741239546875*^9, 
   3.512741283859375*^9}, {3.512741348703125*^9, 3.5127413948125*^9}, {
   3.512741701859375*^9, 3.51274183378125*^9}, {3.5127418746875*^9, 
   3.51274200209375*^9}, {3.5127420515*^9, 3.51274205875*^9}, {
   3.5127421648125*^9, 3.512742165203125*^9}, 3.512873622265625*^9, {
   3.5128736755*^9, 3.5128736756875*^9}, {3.512873723140625*^9, 
   3.51287374965625*^9}, {3.51287380728125*^9, 3.51287391503125*^9}, 
   3.512873985265625*^9, {3.51292132996875*^9, 3.51292133025*^9}, {
   3.51292144075*^9, 3.512921441015625*^9}, {3.5129222058125*^9, 
   3.512922258765625*^9}, {3.512922651375*^9, 3.512922670109375*^9}, {
   3.512922713234375*^9, 3.512922814328125*^9}, {3.51292285453125*^9, 
   3.512923001328125*^9}, {3.51292304475*^9, 3.512923045625*^9}, {
   3.5129231749375*^9, 3.51292321303125*^9}, {3.512923336234375*^9, 
   3.512923372265625*^9}, {3.51292342678125*^9, 3.512923543546875*^9}, {
   3.512923594265625*^9, 3.51292360396875*^9}, {3.51292469615625*^9, 
   3.512924707625*^9}, {3.512924764671875*^9, 3.512924766125*^9}, 
   3.512924810953125*^9, {3.51292484871875*^9, 3.5129248574375*^9}, {
   3.512924906828125*^9, 3.51292492275*^9}, {3.51292509146875*^9, 
   3.512925179875*^9}, {3.512925224890625*^9, 3.512925269015625*^9}, {
   3.512925303515625*^9, 3.512925377*^9}, {3.512925417328125*^9, 
   3.51292545165625*^9}, 3.51292549996875*^9, {3.5129255945*^9, 
   3.5129255970625*^9}, 3.51292563334375*^9, {3.512925692515625*^9, 
   3.5129256926875*^9}, {3.512925740828125*^9, 3.51292576428125*^9}, {
   3.512925806515625*^9, 3.512925835609375*^9}, {3.512925872328125*^9, 
   3.51292590278125*^9}, {3.51292595840625*^9, 3.512925962203125*^9}, {
   3.512926278046875*^9, 3.512926369125*^9}, {3.512929375984375*^9, 
   3.512929444421875*^9}, {3.51292949184375*^9, 3.512929509515625*^9}, {
   3.512929545890625*^9, 3.512929570578125*^9}, {3.512930786140625*^9, 
   3.512930794703125*^9}, {3.512931033796875*^9, 3.512931072890625*^9}, {
   3.5129311425625*^9, 3.512931157609375*^9}, {3.512939377765625*^9, 
   3.51293945046875*^9}, {3.51293951075*^9, 3.512939535921875*^9}, {
   3.51293956915625*^9, 3.512939573328125*^9}, {3.512939777390625*^9, 
   3.512939837203125*^9}, {3.512939898609375*^9, 3.51293997825*^9}, {
   3.512940049328125*^9, 3.512940058671875*^9}, 3.513089235953125*^9, {
   3.51308926825*^9, 3.513089295625*^9}, {3.513089366015625*^9, 
   3.513089366359375*^9}, 3.51308944815625*^9, {3.513089503859375*^9, 
   3.513089519796875*^9}, {3.513089621375*^9, 3.51308962153125*^9}, {
   3.513091138953125*^9, 3.513091168703125*^9}, {3.513091206609375*^9, 
   3.513091207140625*^9}, {3.513091421984375*^9, 3.5130914225*^9}, {
   3.5130916931875*^9, 3.513091723375*^9}, {3.513093005234375*^9, 
   3.513093015421875*^9}, {3.513094833203125*^9, 3.513094833421875*^9}, {
   3.51309496834375*^9, 3.51309496903125*^9}, {3.513096004578125*^9, 
   3.513096012046875*^9}, {3.513096070328125*^9, 3.513096070671875*^9}, {
   3.51309615634375*^9, 3.513096180265625*^9}, 3.513096238609375*^9, {
   3.513096295765625*^9, 3.51309633003125*^9}, {3.51310162490625*^9, 
   3.513101631125*^9}, 3.513103312*^9, {3.51310344196875*^9, 
   3.513103442125*^9}, {3.513181606125*^9, 3.513181606375*^9}, 
   3.5131816894375*^9, {3.513516857203125*^9, 3.513516857359375*^9}, {
   3.514123736203125*^9, 3.51412373653125*^9}, {3.51412387690625*^9, 
   3.514124154953125*^9}, {3.51725866407325*^9, 3.517258696495125*^9}, {
   3.517258726870125*^9, 3.517258728713875*^9}, {3.517258980588875*^9, 
   3.51725898126075*^9}, {3.517259019963875*^9, 3.517259026995125*^9}, {
   3.517261753776375*^9, 3.51726175619825*^9}, {3.517261806776375*^9, 
   3.51726180751075*^9}, {3.51726223207325*^9, 3.517262232417*^9}, {
   3.517262468213875*^9, 3.51726247119825*^9}, {3.517322468234375*^9, 
   3.517322468421875*^9}, {3.517322529640625*^9, 3.517322531625*^9}, {
   3.517322583875*^9, 3.51732261890625*^9}, {3.5173226505625*^9, 
   3.5173226915*^9}, {3.517322741921875*^9, 3.517322746703125*^9}, {
   3.51732278659375*^9, 3.517322787203125*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Digital Triggering Two Channels of Data", "Subsubtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.4493489495064793`*^9, 3.4493489498346043`*^9}, {
   3.4493490471471043`*^9, 3.4493490473658543`*^9}, {3.512695043328125*^9, 
   3.512695072578125*^9}, {3.512695133015625*^9, 3.5126951615*^9}, {
   3.51269522790625*^9, 3.5126952293125*^9}, {3.51269528365625*^9, 
   3.5126953570625*^9}, {3.51269547259375*^9, 3.512695473203125*^9}, {
   3.512695587453125*^9, 3.512695666546875*^9}, {3.512696871703125*^9, 
   3.51269691903125*^9}, 3.512697098125*^9, {3.5126971834375*^9, 
   3.512697246875*^9}, {3.512697596890625*^9, 3.512697629015625*^9}, {
   3.512697708796875*^9, 3.512697714015625*^9}, {3.512697814453125*^9, 
   3.512697848421875*^9}, {3.5126980044375*^9, 3.51269800734375*^9}, {
   3.51269804240625*^9, 3.51269804453125*^9}, {3.5126981378125*^9, 
   3.51269815875*^9}, {3.512698268328125*^9, 3.51269831946875*^9}, {
   3.512698353859375*^9, 3.51269838828125*^9}, {3.51269855046875*^9, 
   3.5126985670625*^9}, {3.5126986135625*^9, 3.51269861590625*^9}, {
   3.51269876228125*^9, 3.512698774203125*^9}, {3.51269886853125*^9, 
   3.51269887409375*^9}, {3.512699050859375*^9, 3.512699064640625*^9}, {
   3.512699214359375*^9, 3.51269923825*^9}, 3.512699344234375*^9, {
   3.512699386078125*^9, 3.51269941790625*^9}, {3.51269948534375*^9, 
   3.512699513796875*^9}, {3.512699550953125*^9, 3.512699551078125*^9}, 
   3.51270001159375*^9, {3.51270004721875*^9, 3.512700072421875*^9}, {
   3.512700138671875*^9, 3.512700198546875*^9}, {3.51270094578125*^9, 
   3.51270094596875*^9}, {3.512701015328125*^9, 3.512701015421875*^9}, {
   3.51273856915625*^9, 3.512738596109375*^9}, {3.5127397274375*^9, 
   3.512739750890625*^9}, 3.51273980725*^9, {3.512740170578125*^9, 
   3.51274019240625*^9}, {3.5127405374375*^9, 3.5127405470625*^9}, {
   3.512740595640625*^9, 3.512740603453125*^9}, {3.512740652515625*^9, 
   3.51274067990625*^9}, {3.512740980046875*^9, 3.512740980203125*^9}, {
   3.512741180015625*^9, 3.5127411963125*^9}, {3.512741239546875*^9, 
   3.512741283859375*^9}, {3.512741348703125*^9, 3.5127413948125*^9}, {
   3.512741701859375*^9, 3.51274183378125*^9}, {3.5127418746875*^9, 
   3.51274200209375*^9}, {3.5127420515*^9, 3.51274205875*^9}, {
   3.5127421648125*^9, 3.512742165203125*^9}, 3.512873622265625*^9, {
   3.5128736755*^9, 3.5128736756875*^9}, {3.512873723140625*^9, 
   3.51287374965625*^9}, {3.51287380728125*^9, 3.51287391503125*^9}, 
   3.512873985265625*^9, {3.51292132996875*^9, 3.51292133025*^9}, {
   3.51292144075*^9, 3.512921441015625*^9}, {3.5129222058125*^9, 
   3.512922258765625*^9}, {3.512922651375*^9, 3.512922670109375*^9}, {
   3.512922713234375*^9, 3.512922814328125*^9}, {3.51292285453125*^9, 
   3.512923001328125*^9}, {3.51292304475*^9, 3.512923045625*^9}, {
   3.5129231749375*^9, 3.51292321303125*^9}, {3.512923336234375*^9, 
   3.512923372265625*^9}, {3.51292342678125*^9, 3.512923543546875*^9}, {
   3.512923594265625*^9, 3.51292360396875*^9}, {3.51292469615625*^9, 
   3.512924707625*^9}, {3.512924764671875*^9, 3.512924766125*^9}, 
   3.512924810953125*^9, {3.51292484871875*^9, 3.5129248574375*^9}, {
   3.512924906828125*^9, 3.51292492275*^9}, {3.51292509146875*^9, 
   3.512925179875*^9}, {3.512925224890625*^9, 3.512925269015625*^9}, {
   3.512925303515625*^9, 3.512925377*^9}, {3.512925417328125*^9, 
   3.51292545165625*^9}, 3.51292549996875*^9, {3.5129255945*^9, 
   3.5129255970625*^9}, 3.51292563334375*^9, {3.512925692515625*^9, 
   3.5129256926875*^9}, {3.512925740828125*^9, 3.51292576428125*^9}, {
   3.512925806515625*^9, 3.512925835609375*^9}, {3.512925872328125*^9, 
   3.51292590278125*^9}, {3.51292595840625*^9, 3.512925962203125*^9}, {
   3.512926278046875*^9, 3.512926369125*^9}, {3.512929375984375*^9, 
   3.512929444421875*^9}, {3.51292949184375*^9, 3.512929509515625*^9}, {
   3.512929545890625*^9, 3.512929570578125*^9}, {3.512930786140625*^9, 
   3.512930794703125*^9}, {3.512931033796875*^9, 3.512931072890625*^9}, {
   3.5129311425625*^9, 3.512931157609375*^9}, {3.512939377765625*^9, 
   3.51293945046875*^9}, {3.51293951075*^9, 3.512939535921875*^9}, {
   3.51293956915625*^9, 3.512939573328125*^9}, {3.512939777390625*^9, 
   3.512939837203125*^9}, {3.512939898609375*^9, 3.51293997825*^9}, {
   3.512940049328125*^9, 3.512940058671875*^9}, 3.513089235953125*^9, {
   3.51308926825*^9, 3.513089295625*^9}, {3.513089366015625*^9, 
   3.513089366359375*^9}, 3.51308944815625*^9, {3.513089503859375*^9, 
   3.513089519796875*^9}, {3.513089621375*^9, 3.51308962153125*^9}, {
   3.513091138953125*^9, 3.513091168703125*^9}, {3.513091206609375*^9, 
   3.513091207140625*^9}, {3.513091421984375*^9, 3.5130914225*^9}, {
   3.5130916931875*^9, 3.513091723375*^9}, {3.513093005234375*^9, 
   3.513093015421875*^9}, {3.513094833203125*^9, 3.513094833421875*^9}, {
   3.51309496834375*^9, 3.51309496903125*^9}, {3.513096004578125*^9, 
   3.513096012046875*^9}, {3.513096070328125*^9, 3.513096070671875*^9}, {
   3.51309615634375*^9, 3.513096180265625*^9}, 3.513096238609375*^9, {
   3.513096295765625*^9, 3.51309637178125*^9}, {3.51309705390625*^9, 
   3.513097060015625*^9}}],

Cell["\<\
Remember that second output channel is connected to input channel 3 on MY \
hardware test rig.  Software \
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.4493489495064793`*^9, 3.4493489498346043`*^9}, {
   3.4493490471471043`*^9, 3.4493490473658543`*^9}, {3.512695043328125*^9, 
   3.512695072578125*^9}, {3.512695133015625*^9, 3.5126951615*^9}, {
   3.51269522790625*^9, 3.5126952293125*^9}, {3.51269528365625*^9, 
   3.5126953570625*^9}, {3.51269547259375*^9, 3.512695473203125*^9}, {
   3.512695587453125*^9, 3.512695666546875*^9}, {3.512696871703125*^9, 
   3.51269691903125*^9}, 3.512697098125*^9, {3.5126971834375*^9, 
   3.512697246875*^9}, {3.512697596890625*^9, 3.512697629015625*^9}, {
   3.512697708796875*^9, 3.512697714015625*^9}, {3.512697814453125*^9, 
   3.512697848421875*^9}, {3.5126980044375*^9, 3.51269800734375*^9}, {
   3.51269804240625*^9, 3.51269804453125*^9}, {3.5126981378125*^9, 
   3.51269815875*^9}, {3.512698268328125*^9, 3.51269831946875*^9}, {
   3.512698353859375*^9, 3.51269838828125*^9}, {3.51269855046875*^9, 
   3.5126985670625*^9}, {3.5126986135625*^9, 3.51269861590625*^9}, {
   3.51269876228125*^9, 3.512698774203125*^9}, {3.51269886853125*^9, 
   3.51269887409375*^9}, {3.512699050859375*^9, 3.512699064640625*^9}, {
   3.512699214359375*^9, 3.51269923825*^9}, 3.512699344234375*^9, {
   3.512699386078125*^9, 3.51269941790625*^9}, {3.51269948534375*^9, 
   3.512699513796875*^9}, {3.512699550953125*^9, 3.512699551078125*^9}, 
   3.51270001159375*^9, {3.51270004721875*^9, 3.512700072421875*^9}, {
   3.512700138671875*^9, 3.512700198546875*^9}, {3.51270094578125*^9, 
   3.51270094596875*^9}, {3.512701015328125*^9, 3.512701015421875*^9}, {
   3.51273856915625*^9, 3.512738596109375*^9}, {3.5127397274375*^9, 
   3.512739750890625*^9}, 3.51273980725*^9, {3.512740170578125*^9, 
   3.51274019240625*^9}, {3.5127405374375*^9, 3.5127405470625*^9}, {
   3.512740595640625*^9, 3.512740603453125*^9}, {3.512740652515625*^9, 
   3.51274067990625*^9}, {3.512740980046875*^9, 3.512740980203125*^9}, {
   3.512741180015625*^9, 3.5127411963125*^9}, {3.512741239546875*^9, 
   3.512741283859375*^9}, {3.512741348703125*^9, 3.5127413948125*^9}, {
   3.512741701859375*^9, 3.51274183378125*^9}, {3.5127418746875*^9, 
   3.51274200209375*^9}, {3.5127420515*^9, 3.51274205875*^9}, {
   3.5127421648125*^9, 3.512742165203125*^9}, 3.512873622265625*^9, {
   3.5128736755*^9, 3.5128736756875*^9}, {3.512873723140625*^9, 
   3.51287374965625*^9}, {3.51287380728125*^9, 3.51287391503125*^9}, 
   3.512873985265625*^9, {3.51292132996875*^9, 3.51292133025*^9}, {
   3.51292144075*^9, 3.512921441015625*^9}, {3.5129222058125*^9, 
   3.512922258765625*^9}, {3.512922651375*^9, 3.512922670109375*^9}, {
   3.512922713234375*^9, 3.512922814328125*^9}, {3.51292285453125*^9, 
   3.512923001328125*^9}, {3.51292304475*^9, 3.512923045625*^9}, {
   3.5129231749375*^9, 3.51292321303125*^9}, {3.512923336234375*^9, 
   3.512923372265625*^9}, {3.51292342678125*^9, 3.512923543546875*^9}, {
   3.512923594265625*^9, 3.51292360396875*^9}, {3.51292469615625*^9, 
   3.512924707625*^9}, {3.512924764671875*^9, 3.512924766125*^9}, 
   3.512924810953125*^9, {3.51292484871875*^9, 3.5129248574375*^9}, {
   3.512924906828125*^9, 3.51292492275*^9}, {3.51292509146875*^9, 
   3.512925179875*^9}, {3.512925224890625*^9, 3.512925269015625*^9}, {
   3.512925303515625*^9, 3.512925377*^9}, {3.512925417328125*^9, 
   3.51292545165625*^9}, 3.51292549996875*^9, {3.5129255945*^9, 
   3.5129255970625*^9}, 3.51292563334375*^9, {3.512925692515625*^9, 
   3.5129256926875*^9}, {3.512925740828125*^9, 3.51292576428125*^9}, {
   3.512925806515625*^9, 3.512925835609375*^9}, {3.512925872328125*^9, 
   3.51292590278125*^9}, {3.51292595840625*^9, 3.512925962203125*^9}, {
   3.512926278046875*^9, 3.512926369125*^9}, {3.512929375984375*^9, 
   3.512929444421875*^9}, {3.51292949184375*^9, 3.512929509515625*^9}, {
   3.512929545890625*^9, 3.512929570578125*^9}, {3.512930786140625*^9, 
   3.512930794703125*^9}, {3.512931033796875*^9, 3.512931072890625*^9}, {
   3.5129311425625*^9, 3.512931157609375*^9}, {3.512939377765625*^9, 
   3.51293945046875*^9}, {3.51293951075*^9, 3.512939535921875*^9}, {
   3.51293956915625*^9, 3.512939573328125*^9}, {3.512939777390625*^9, 
   3.512939837203125*^9}, {3.512939898609375*^9, 3.51293997825*^9}, {
   3.512940049328125*^9, 3.512940058671875*^9}, 3.513089235953125*^9, {
   3.51308926825*^9, 3.513089295625*^9}, {3.513089366015625*^9, 
   3.513089366359375*^9}, 3.51308944815625*^9, {3.513089503859375*^9, 
   3.513089519796875*^9}, {3.513089621375*^9, 3.51308962153125*^9}, {
   3.513091138953125*^9, 3.513091168703125*^9}, {3.513091206609375*^9, 
   3.513091207140625*^9}, {3.513091421984375*^9, 3.5130914225*^9}, {
   3.5130916931875*^9, 3.513091723375*^9}, {3.513093005234375*^9, 
   3.513093015421875*^9}, {3.513094833203125*^9, 3.513094833421875*^9}, {
   3.51309496834375*^9, 3.51309496903125*^9}, {3.513096004578125*^9, 
   3.513096012046875*^9}, {3.513096070328125*^9, 3.513096070671875*^9}, {
   3.51309615634375*^9, 3.513096180265625*^9}, 3.513096238609375*^9, {
   3.513096295765625*^9, 3.51309637178125*^9}, {3.51309705390625*^9, 
   3.5130971290625*^9}, {3.517319446203125*^9, 3.517319458734375*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "LogTest`TestName", "[", "\"\<Digital triggering two channels of Data\>\"", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{" ", 
  RowBox[{
   RowBox[{"Clear", "[", 
    RowBox[{
    "ansDigital", ",", "ansAnalog", ",", " ", "conds", ",", " ", "plots", ",",
      "plotDigital", ",", "plotAnalog"}], "]"}], 
   ";"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"numPts", "=", "100"}], ";", " ", 
  RowBox[{"fout", " ", "=", " ", "10000.0"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"fin", " ", "=", "10000.0"}], ";", 
  RowBox[{"preTrigSamples", " ", "=", " ", "15"}], ";", 
  RowBox[{"postTriggerSamples", " ", "=", " ", "20"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"commonOpts", " ", "=", " ", 
    RowBox[{"Sequence", "[", " ", 
     RowBox[{
      RowBox[{"PreTriggerSamples", "\[Rule]", "preTrigSamples"}], ",", 
      RowBox[{"MessageLevel", "\[Rule]", "0"}], ",", 
      RowBox[{"TriggerSlope", "\[Rule]", "Rising"}], ",", 
      RowBox[{"IncludeTime", "\[Rule]", "Omit"}], ",", 
      RowBox[{"TransferMechanism", " ", "\[Rule]", "Interrupts"}]}], "]"}]}], 
   ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p1", " ", "=", " ", 
   RowBox[{"ListPlot", "[", 
    RowBox[{
     RowBox[{"waveOut", " ", "=", " ", 
      RowBox[{"Transpose", "[", 
       RowBox[{"Join", "[", 
        RowBox[{
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"-", "1"}], ",", 
             RowBox[{"-", "2"}]}], "}"}], ",", 
           RowBox[{"{", "100", "}"}]}], "]"}], ",", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"5", ",", 
             RowBox[{"-", "2.5"}]}], "}"}], ",", 
           RowBox[{"{", "100", "}"}]}], "]"}]}], "]"}], "]"}]}], ",", 
     RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"th", " ", "=", " ", 
   RowBox[{"OutputWaveform", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "1"}], "}"}], ",", "waveOut", ",", " ", "fout", ",", 
     "1", ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}], ",", 
     RowBox[{"TransferMechanism", " ", "\[Rule]", "DMA"}], ",", 
     RowBox[{"MessageLevel", " ", "\[Rule]", "0"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"plots", "=", 
   RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"conds", " ", "=", 
    RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "first", " ", "test", " ", "trigger", " ", "on", " ", "signal", " ", 
    "that", " ", "you", " ", "are", " ", "recording"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{"ansDigital", ",", "extraDigital"}], "}"}], " ", "=", " ", 
   RowBox[{"GetVoltagesDigTrig", "[", 
    RowBox[{
     RowBox[{"channels", " ", "=", 
      RowBox[{"{", 
       RowBox[{"0", ",", "3"}], "}"}]}], ",", "fin", ",", 
     "postTriggerSamples", ",", 
     RowBox[{"trigChannel", " ", "=", " ", "0"}], ",", "commonOpts", ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"conds", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"conds", ",", 
     RowBox[{
      RowBox[{"ansDigital", "[", 
       RowBox[{"[", "preTrigSamples", "]"}], "]"}], " ", "<", " ", "2.5", " ",
       "<", " ", 
      RowBox[{"ansDigital", "[", 
       RowBox[{"[", 
        RowBox[{"preTrigSamples", " ", "+", "1"}], "]"}], "]"}]}]}], " ", 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"plots", "=", " ", 
    RowBox[{"Append", "[", 
     RowBox[{"plots", ",", " ", 
      RowBox[{"ListPlot", "[", 
       RowBox[{"{", 
        RowBox[{"ansDigital", ",", "extraDigital"}], "}"}], "]"}]}], "]"}]}], 
   ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "Software", " ", "triggering", " ", "takes", " ", "too", " ", "long", " ", 
    "at", " ", "slow", " ", "speeds", " ", "suspect", " ", "finite", " ", 
    "number", " ", "in", " ", "testing", " ", "array", " ", "must", " ", "be",
     " ", "read", " ", "before", " ", "returning"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{"ansAnalog", ",", "extraAnalog"}], "}"}], "=", " ", 
   RowBox[{"GetVoltagesTrig", "[", 
    RowBox[{
     RowBox[{"channels", " ", "=", 
      RowBox[{"{", 
       RowBox[{"0", ",", "3"}], "}"}]}], ",", "fin", ",", 
     "postTriggerSamples", ",", 
     RowBox[{"trigChannel", " ", "=", " ", "0"}], ",", 
     RowBox[{"triggerLevel", "=", "2.0"}], ",", "commonOpts", ",", 
     RowBox[{"SampleMode", " ", "\[Rule]", " ", "Continuous"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{" ", 
  RowBox[{
   RowBox[{"conds", " ", "=", " ", 
    RowBox[{"Append", "[", 
     RowBox[{"conds", ",", " ", 
      RowBox[{
       RowBox[{"ansAnalog", "[", 
        RowBox[{"[", "preTrigSamples", "]"}], "]"}], " ", "<", " ", 
       "triggerLevel", " ", "<", " ", 
       RowBox[{"ansAnalog", "[", 
        RowBox[{"[", 
         RowBox[{"preTrigSamples", "+", "1"}], "]"}], "]"}]}]}], " ", "]"}]}],
    ";"}], " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"plots", " ", "=", " ", 
   RowBox[{"Append", "[", 
    RowBox[{"plots", ",", 
     RowBox[{"ListPlot", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"ansAnalog", ",", " ", "extraAnalog"}], "}"}], ",", " ", 
       RowBox[{"Joined", "\[Rule]", "True"}]}], "]"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"conds", ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Show", "[", 
   RowBox[{"plots", ",", 
    RowBox[{"PlotRange", "\[Rule]", " ", "All"}]}], "]"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ClearTask", "[", "th", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"OutputWaveform", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"0", ",", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", "0", "}"}], ",", 
      RowBox[{"{", "0", "}"}]}], "}"}], ",", "1", ",", "1"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"LogTest`Assert", "[", 
  RowBox[{"And", "@@", "conds"}], "]"}], "\[IndentingNewLine]"}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.4493489495064793`*^9, 3.4493489498346043`*^9}, {
   3.4493490471471043`*^9, 3.4493490473658543`*^9}, {3.512695043328125*^9, 
   3.512695072578125*^9}, {3.512695133015625*^9, 3.5126951615*^9}, {
   3.51269522790625*^9, 3.5126952293125*^9}, {3.51269528365625*^9, 
   3.5126953570625*^9}, {3.51269547259375*^9, 3.512695473203125*^9}, {
   3.512695587453125*^9, 3.512695666546875*^9}, {3.512696871703125*^9, 
   3.51269691903125*^9}, 3.512697098125*^9, {3.5126971834375*^9, 
   3.512697246875*^9}, {3.512697596890625*^9, 3.512697629015625*^9}, {
   3.512697708796875*^9, 3.512697714015625*^9}, {3.512697814453125*^9, 
   3.512697848421875*^9}, {3.5126980044375*^9, 3.51269800734375*^9}, {
   3.51269804240625*^9, 3.51269804453125*^9}, {3.5126981378125*^9, 
   3.51269815875*^9}, {3.512698268328125*^9, 3.51269831946875*^9}, {
   3.512698353859375*^9, 3.51269838828125*^9}, {3.51269855046875*^9, 
   3.5126985670625*^9}, {3.5126986135625*^9, 3.51269861590625*^9}, {
   3.51269876228125*^9, 3.512698774203125*^9}, {3.51269886853125*^9, 
   3.51269887409375*^9}, {3.512699050859375*^9, 3.512699064640625*^9}, {
   3.512699214359375*^9, 3.51269923825*^9}, 3.512699344234375*^9, {
   3.512699386078125*^9, 3.51269941790625*^9}, {3.51269948534375*^9, 
   3.512699513796875*^9}, {3.512699550953125*^9, 3.512699551078125*^9}, 
   3.51270001159375*^9, {3.51270004721875*^9, 3.512700072421875*^9}, {
   3.512700138671875*^9, 3.512700198546875*^9}, {3.51270094578125*^9, 
   3.51270094596875*^9}, {3.512701015328125*^9, 3.512701015421875*^9}, {
   3.51273856915625*^9, 3.512738596109375*^9}, {3.5127397274375*^9, 
   3.512739750890625*^9}, 3.51273980725*^9, {3.512740170578125*^9, 
   3.51274019240625*^9}, {3.5127405374375*^9, 3.5127405470625*^9}, {
   3.512740595640625*^9, 3.512740603453125*^9}, {3.512740652515625*^9, 
   3.51274067990625*^9}, {3.512740980046875*^9, 3.512740980203125*^9}, {
   3.512741180015625*^9, 3.5127411963125*^9}, {3.512741239546875*^9, 
   3.512741283859375*^9}, {3.512741348703125*^9, 3.5127413948125*^9}, {
   3.512741701859375*^9, 3.51274183378125*^9}, {3.5127418746875*^9, 
   3.51274200209375*^9}, {3.5127420515*^9, 3.51274205875*^9}, {
   3.5127421648125*^9, 3.512742165203125*^9}, 3.512873622265625*^9, {
   3.5128736755*^9, 3.5128736756875*^9}, {3.512873723140625*^9, 
   3.51287374965625*^9}, {3.51287380728125*^9, 3.51287391503125*^9}, 
   3.512873985265625*^9, {3.51292132996875*^9, 3.51292133025*^9}, {
   3.51292144075*^9, 3.512921441015625*^9}, {3.5129222058125*^9, 
   3.512922258765625*^9}, {3.512922651375*^9, 3.512922670109375*^9}, {
   3.512922713234375*^9, 3.512922814328125*^9}, {3.51292285453125*^9, 
   3.512923001328125*^9}, {3.51292304475*^9, 3.512923045625*^9}, {
   3.5129231749375*^9, 3.51292321303125*^9}, {3.512923336234375*^9, 
   3.512923372265625*^9}, {3.51292342678125*^9, 3.512923543546875*^9}, {
   3.512923594265625*^9, 3.51292360396875*^9}, {3.51292469615625*^9, 
   3.512924707625*^9}, {3.512924764671875*^9, 3.512924766125*^9}, 
   3.512924810953125*^9, {3.51292484871875*^9, 3.5129248574375*^9}, {
   3.512924906828125*^9, 3.51292492275*^9}, {3.51292509146875*^9, 
   3.512925179875*^9}, {3.512925224890625*^9, 3.512925269015625*^9}, {
   3.512925303515625*^9, 3.512925377*^9}, {3.512925417328125*^9, 
   3.51292545165625*^9}, 3.51292549996875*^9, {3.5129255945*^9, 
   3.5129255970625*^9}, 3.51292563334375*^9, {3.512925692515625*^9, 
   3.5129256926875*^9}, {3.512925740828125*^9, 3.51292576428125*^9}, {
   3.512925806515625*^9, 3.512925835609375*^9}, {3.512925872328125*^9, 
   3.51292590278125*^9}, {3.51292595840625*^9, 3.512925962203125*^9}, {
   3.512926278046875*^9, 3.512926369125*^9}, {3.512929375984375*^9, 
   3.512929444421875*^9}, {3.51292949184375*^9, 3.512929509515625*^9}, {
   3.512929545890625*^9, 3.512929570578125*^9}, {3.512930786140625*^9, 
   3.512930794703125*^9}, {3.512931033796875*^9, 3.512931072890625*^9}, {
   3.5129311425625*^9, 3.512931157609375*^9}, {3.512939377765625*^9, 
   3.51293945046875*^9}, {3.51293951075*^9, 3.512939535921875*^9}, {
   3.51293956915625*^9, 3.512939573328125*^9}, {3.512939777390625*^9, 
   3.512939837203125*^9}, {3.512939898609375*^9, 3.51293997825*^9}, {
   3.512940049328125*^9, 3.512940058671875*^9}, 3.513089235953125*^9, {
   3.51308926825*^9, 3.513089295625*^9}, {3.513089366015625*^9, 
   3.513089366359375*^9}, 3.51308944815625*^9, {3.513089503859375*^9, 
   3.513089519796875*^9}, {3.513089621375*^9, 3.51308962153125*^9}, {
   3.513091138953125*^9, 3.513091168703125*^9}, {3.513091206609375*^9, 
   3.513091207140625*^9}, {3.513091421984375*^9, 3.5130914225*^9}, {
   3.5130916931875*^9, 3.513091723375*^9}, {3.513093005234375*^9, 
   3.513093015421875*^9}, {3.513094833203125*^9, 3.513094833421875*^9}, {
   3.51309496834375*^9, 3.51309496903125*^9}, {3.513096004578125*^9, 
   3.513096012046875*^9}, {3.513096070328125*^9, 3.513096070671875*^9}, {
   3.51309615634375*^9, 3.513096180265625*^9}, 3.513096238609375*^9, {
   3.513096295765625*^9, 3.51309637178125*^9}, {3.513096463515625*^9, 
   3.51309654584375*^9}, {3.513096611984375*^9, 3.513096661546875*^9}, {
   3.513096894015625*^9, 3.513096902078125*^9}, {3.513096955796875*^9, 
   3.51309695909375*^9}, {3.513097020375*^9, 3.51309702290625*^9}, {
   3.513099925296875*^9, 3.513099976421875*^9}, 3.513100294890625*^9, {
   3.513100334015625*^9, 3.513100357890625*^9}, {3.513101132953125*^9, 
   3.51310114859375*^9}, 3.51310118134375*^9, {3.513101211421875*^9, 
   3.51310121909375*^9}, {3.51310126090625*^9, 3.51310126903125*^9}, {
   3.513101569359375*^9, 3.51310158928125*^9}, {3.51310210390625*^9, 
   3.51310210746875*^9}, {3.513103650359375*^9, 3.51310365053125*^9}, {
   3.5131037023125*^9, 3.51310370271875*^9}, {3.51310376715625*^9, 
   3.51310381665625*^9}, {3.513181724421875*^9, 3.51318172471875*^9}, {
   3.513517063953125*^9, 3.5135170641875*^9}, {3.5141236994375*^9, 
   3.51412369971875*^9}, {3.517258508026375*^9, 3.51725852551075*^9}, {
   3.5172585727295*^9, 3.517258575338875*^9}, {3.51725865269825*^9, 
   3.51725865301075*^9}, {3.51726186382325*^9, 3.517261872682625*^9}, {
   3.51726192576075*^9, 3.51726192838575*^9}, {3.517261962620125*^9, 
   3.5172619637295*^9}, {3.51726201226075*^9, 3.51726204869825*^9}, {
   3.51726240044825*^9, 3.51726240213575*^9}, {3.5173188545625*^9, 
   3.51731889*^9}, {3.517318934984375*^9, 3.51731895453125*^9}, {
   3.51731900321875*^9, 3.51731905240625*^9}, {3.517319094484375*^9, 
   3.517319160625*^9}, {3.517319193640625*^9, 3.51731922309375*^9}, {
   3.51731925684375*^9, 3.517319325640625*^9}, {3.51731938234375*^9, 
   3.517319428*^9}, {3.517319479296875*^9, 3.5173195195*^9}, {
   3.517319558546875*^9, 3.51731957134375*^9}, {3.5173196085625*^9, 
   3.517319615015625*^9}, {3.5173196468125*^9, 3.5173197044375*^9}, {
   3.51731981775*^9, 3.51731983525*^9}, {3.517319980265625*^9, 
   3.517319983625*^9}, {3.5173202093125*^9, 3.517320217*^9}, {
   3.517320405421875*^9, 3.517320406078125*^9}, {3.517320484796875*^9, 
   3.51732049384375*^9}, {3.517320568125*^9, 3.5173205686875*^9}, {
   3.51732063803125*^9, 3.51732069953125*^9}, 3.517320748921875*^9, {
   3.517320799578125*^9, 3.517320822390625*^9}, {3.517320855921875*^9, 
   3.517320861171875*^9}, {3.517320988875*^9, 3.517320991859375*^9}}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Tally the Tests", "Subtitle",
 InitializationCell->True,
 CellChangeTimes->{{3.422119893809637*^9, 3.422119953024784*^9}, {
   3.4221199889364223`*^9, 3.4221200131412272`*^9}, {3.4221200756911697`*^9, 
   3.42212007935644*^9}, 3.512681512703125*^9}],

Cell["\<\
Print the nummber of successes and failures as recorded in log file.\
\>", "Text",
 InitializationCell->True,
 CellChangeTimes->{{3.422119893809637*^9, 3.422119953024784*^9}, {
  3.4221199889364223`*^9, 3.4221200131412272`*^9}, {3.4221200756911697`*^9, 
  3.422120113805976*^9}, {3.512681535234375*^9, 3.512681565265625*^9}}],

Cell[BoxData[
 RowBox[{"LogTest`TallyTests", "[", "]"}]], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.422119893809637*^9, 3.422119953024784*^9}, 
   3.4221199889364223`*^9, 3.4221200454677105`*^9, {3.4222368190239134`*^9, 
   3.4222368203658433`*^9}}]
}, Open  ]],

Cell["\<\
Note: DMA waits for a block of data to transfer
Interrupts need to be in continuous mode
two channels need work\
\>", "Subtitle",
 CellChangeTimes->{{3.517262066151375*^9, 3.517262114151375*^9}, {
  3.517262320463875*^9, 3.517262338807625*^9}}]
},
AutoGeneratedPackage->Automatic,
CellGrouping->Manual,
WindowSize->{1234, 858},
WindowMargins->{{1, Automatic}, {Automatic, 1}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic},
ShowSelection->True,
FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (November 10, 2008)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[567, 22, 376, 6, 49, "Subtitle",
 InitializationCell->True],
Cell[946, 30, 791, 13, 83, "Text",
 InitializationCell->True],
Cell[1740, 45, 1446, 31, 112, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[3223, 81, 326, 5, 49, "Subtitle",
 InitializationCell->True],
Cell[3552, 88, 582, 10, 47, "Text",
 InitializationCell->True],
Cell[4137, 100, 11333, 239, 1652, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[15507, 344, 170, 2, 49, "Subtitle"],
Cell[15680, 348, 709, 12, 65, "Text"],
Cell[16392, 362, 612, 10, 92, "Input"],
Cell[17007, 374, 690, 15, 72, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[17734, 394, 151, 2, 49, "Subtitle",
 InitializationCell->True],
Cell[17888, 398, 616, 11, 65, "Text",
 InitializationCell->True],
Cell[18507, 411, 6408, 130, 472, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[24952, 546, 203, 3, 49, "Subtitle"],
Cell[25158, 551, 209, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[25392, 558, 1582, 29, 252, "Input"],
Cell[26977, 589, 784, 11, 31, "Input"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[27810, 606, 921, 12, 49, "Subtitle"],
Cell[28734, 620, 1296, 21, 31, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[30067, 646, 1000, 14, 49, "Subtitle",
 InitializationCell->True],
Cell[31070, 662, 1042, 16, 29, "Text",
 InitializationCell->True],
Cell[CellGroupData[{
Cell[32137, 682, 1063, 14, 28, "Subsubtitle",
 InitializationCell->True],
Cell[33203, 698, 1229, 19, 65, "Text",
 InitializationCell->True],
Cell[34435, 719, 4761, 109, 332, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[39233, 833, 1196, 16, 28, "Subsubtitle",
 InitializationCell->True],
Cell[40432, 851, 1249, 19, 29, "Text",
 InitializationCell->True],
Cell[41684, 872, 4221, 98, 152, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[45942, 975, 1333, 20, 28, "Subsubtitle",
 InitializationCell->True],
Cell[47278, 997, 1800, 26, 29, "Text",
 InitializationCell->True],
Cell[49081, 1025, 5825, 128, 172, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[54943, 1158, 2283, 32, 28, "Subsubtitle",
 InitializationCell->True],
Cell[57229, 1192, 2662, 37, 47, "Text",
 InitializationCell->True],
Cell[59894, 1231, 4574, 91, 212, "Input",
 InitializationCell->True],
Cell[64471, 1324, 5232, 114, 192, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[69740, 1443, 2564, 35, 28, "Subsubtitle",
 InitializationCell->True],
Cell[72307, 1480, 3258, 57, 72, "Input",
 InitializationCell->True],
Cell[75568, 1539, 3829, 71, 92, "Input",
 InitializationCell->True],
Cell[79400, 1612, 6580, 137, 292, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[86017, 1754, 305, 6, 28, "Subsubtitle",
 InitializationCell->True],
Cell[86325, 1762, 6733, 133, 272, "Input",
 InitializationCell->True]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[93107, 1901, 2210, 29, 49, "Subtitle",
 InitializationCell->True],
Cell[95320, 1932, 2558, 39, 29, "Text",
 InitializationCell->True],
Cell[97881, 1973, 8936, 182, 492, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[106854, 2160, 310, 4, 49, "Subtitle"],
Cell[107167, 2166, 620, 14, 55, "Text"],
Cell[CellGroupData[{
Cell[107812, 2184, 947, 13, 28, "Subsubtitle",
 InitializationCell->True],
Cell[108762, 2199, 6981, 171, 472, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[115780, 2375, 1798, 26, 28, "Subsubtitle"],
Cell[117581, 2403, 2201, 32, 47, "Text"],
Cell[119785, 2437, 6459, 154, 392, "Input",
 InitializationCell->True],
Cell[126247, 2593, 834, 11, 31, "Input"]
}, Open  ]],
Cell[CellGroupData[{
Cell[127118, 2609, 657, 10, 28, "Subsubtitle"],
Cell[127778, 2621, 683, 9, 29, "Text"],
Cell[128464, 2632, 5658, 149, 352, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[134159, 2786, 2742, 57, 112, "Input"],
Cell[136904, 2845, 704, 10, 52, "Input"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[137657, 2861, 252, 3, 49, "Subtitle"],
Cell[137912, 2866, 343, 6, 29, "Text"],
Cell[138258, 2874, 3752, 94, 272, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[142047, 2973, 205, 3, 49, "Subtitle"],
Cell[142255, 2978, 334, 8, 29, "Text"],
Cell[142592, 2988, 1455, 35, 112, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[144084, 3028, 335, 5, 49, "Subtitle"],
Cell[CellGroupData[{
Cell[144444, 3037, 416, 6, 28, "Subsubtitle"],
Cell[144863, 3045, 3389, 51, 65, "Text",
 InitializationCell->True],
Cell[148255, 3098, 9910, 225, 592, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[158202, 3328, 2188, 31, 28, "Subsubtitle",
 InitializationCell->True],
Cell[160393, 3361, 7489, 160, 312, "Input",
 InitializationCell->True]
}, Closed]],
Cell[CellGroupData[{
Cell[167919, 3526, 3310, 47, 28, "Subsubtitle",
 InitializationCell->True],
Cell[171232, 3575, 3514, 51, 47, "Text",
 InitializationCell->True],
Cell[174749, 3628, 9224, 224, 452, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[184010, 3857, 1213, 18, 28, "Subsubtitle"],
Cell[185226, 3877, 1359, 21, 83, "Text"],
Cell[186588, 3900, 8084, 199, 472, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[194709, 4104, 1490, 21, 28, "Subsubtitle",
 InitializationCell->True],
Cell[196202, 4127, 7470, 177, 432, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[203709, 4309, 1842, 28, 28, "Subsubtitle",
 InitializationCell->True],
Cell[205554, 4339, 2857, 42, 29, "Text",
 InitializationCell->True],
Cell[208414, 4383, 8798, 185, 738, "Input",
 InitializationCell->True]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[217261, 4574, 258, 3, 49, "Subtitle"],
Cell[217522, 4579, 1346, 25, 137, "Text"],
Cell[CellGroupData[{
Cell[218893, 4608, 5028, 72, 28, "Subsubtitle",
 InitializationCell->True],
Cell[223924, 4682, 13289, 282, 712, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[CellGroupData[{
Cell[237250, 4969, 5157, 74, 28, "Subsubtitle",
 InitializationCell->True],
Cell[242410, 5045, 5268, 77, 29, "Text",
 InitializationCell->True],
Cell[247681, 5124, 13768, 280, 572, "Input",
 InitializationCell->True]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[261498, 5410, 255, 4, 49, "Subtitle",
 InitializationCell->True],
Cell[261756, 5416, 335, 6, 29, "Text",
 InitializationCell->True],
Cell[262094, 5424, 265, 5, 31, "Input",
 InitializationCell->True]
}, Open  ]],
Cell[262374, 5432, 254, 6, 105, "Subtitle"]
}
]
*)

(* End of internal cache information *)
